mirror of
https://github.com/cranci1/Sora.git
synced 2026-07-26 14:32:21 +00:00
Fixed Module Settings UI
This commit is contained in:
parent
63a8542203
commit
d60469b2e7
1 changed files with 2 additions and 15 deletions
|
|
@ -163,27 +163,14 @@ struct ModuleSettingsView: View {
|
|||
private struct ModuleSettingRow: View {
|
||||
@Binding var setting: ModuleSetting
|
||||
|
||||
private var icon: String {
|
||||
switch setting.type {
|
||||
case .bool: return "switch.2"
|
||||
case .int, .float: return "number"
|
||||
case .string: return "textformat"
|
||||
}
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
HStack(alignment: .top) {
|
||||
Image(systemName: icon)
|
||||
.frame(width: 24, height: 24)
|
||||
.foregroundStyle(.primary)
|
||||
.padding(.top, 2)
|
||||
|
||||
VStack(alignment: .leading, spacing: 2) {
|
||||
Text(setting.comment ?? setting.key)
|
||||
Text(setting.key)
|
||||
.foregroundStyle(.primary)
|
||||
|
||||
if setting.comment != nil {
|
||||
Text(setting.key)
|
||||
Text(setting.comment!)
|
||||
.font(.caption2)
|
||||
.foregroundStyle(.gray)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue