From 7b77cfc3de4d584cd833b832b0447812138d7105 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Fri, 1 Dec 2023 16:33:17 -0800 Subject: [PATCH] Ambient lighting updates --- .../Config/Module/AmbientLightingConfig.swift | 39 ++++++++++--------- de.lproj/Localizable.strings | 2 + en.lproj/Localizable.strings | 2 + pl.lproj/Localizable.strings | 2 + zh-Hans.lproj/Localizable.strings | 2 + 5 files changed, 28 insertions(+), 19 deletions(-) diff --git a/Meshtastic/Views/Settings/Config/Module/AmbientLightingConfig.swift b/Meshtastic/Views/Settings/Config/Module/AmbientLightingConfig.swift index f5e9dc26..bd59c988 100644 --- a/Meshtastic/Views/Settings/Config/Module/AmbientLightingConfig.swift +++ b/Meshtastic/Views/Settings/Config/Module/AmbientLightingConfig.swift @@ -54,24 +54,25 @@ struct AmbientLightingConfig: View { .foregroundColor(.orange) } Section(header: Text("options")) { - VStack { - Toggle(isOn: $ledState) { - Label("LED State", systemImage: ledState ? "lightbulb.led.fill" : "lightbulb.led") - } - .toggleStyle(SwitchToggleStyle(tint: .accentColor)) - HStack { - Image(systemName: "eyedropper") - .foregroundColor(.accentColor) - ColorPicker("Color", selection: $color, supportsOpacity: false) - .padding(5) - } - HStack { - Image(systemName: "directcurrent") - .foregroundColor(.accentColor) - Stepper("Current: \(current)", value: $current, in: 0...31, step: 1) - .padding(5) - } - + Toggle(isOn: $ledState) { + Label("LED State", systemImage: ledState ? "lightbulb.led.fill" : "lightbulb.led") + } + .toggleStyle(SwitchToggleStyle(tint: .accentColor)) + .listRowSeparator(.hidden) + Text("The state of the LED (on/off)") + .font(.caption) + .foregroundStyle(.gray) + HStack { + Image(systemName: "eyedropper") + .foregroundColor(.accentColor) + ColorPicker("Color", selection: $color, supportsOpacity: false) + .padding(5) + } + HStack { + Image(systemName: "directcurrent") + .foregroundColor(.accentColor) + Stepper("Current: \(current)", value: $current, in: 0...31, step: 1) + .padding(5) } .onChange(of: color, initial: true) { components = color.resolve(in: environment) @@ -79,7 +80,7 @@ struct AmbientLightingConfig: View { } } } - //.disabled(self.bleManager.connectedPeripheral == nil || node?.ambientLightingConfig == nil) + .disabled(self.bleManager.connectedPeripheral == nil || node?.ambientLightingConfig == nil) Button { isPresentingSaveConfirm = true } label: { diff --git a/de.lproj/Localizable.strings b/de.lproj/Localizable.strings index 60d9ff6b..daed2a2f 100644 --- a/de.lproj/Localizable.strings +++ b/de.lproj/Localizable.strings @@ -12,6 +12,8 @@ "ago"="her"; "airtime"="Airtime"; "always.on"="Immer an"; +"ambient.lighting"="Ambient Lighting"; +"ambient.lighting.config"="Ambient Lighting Config"; "app.settings"="App Einstellungen"; "are.you.sure"="Bist Du sicher?"; "ascii.capable"="ASCII fähig"; diff --git a/en.lproj/Localizable.strings b/en.lproj/Localizable.strings index 23c19d6a..6d47569c 100644 --- a/en.lproj/Localizable.strings +++ b/en.lproj/Localizable.strings @@ -12,6 +12,8 @@ "ago"="ago"; "airtime"="Airtime"; "always.on"="Always On"; +"ambient.lighting"="Ambient Lighting"; +"ambient.lighting.config"="Ambient Lighting Config"; "app.settings"="App Settings"; "are.you.sure"="Are you sure?"; "ascii.capable"="ASCII Capable"; diff --git a/pl.lproj/Localizable.strings b/pl.lproj/Localizable.strings index 489db06a..50c1c882 100644 --- a/pl.lproj/Localizable.strings +++ b/pl.lproj/Localizable.strings @@ -14,6 +14,8 @@ "ago"="temu"; "airtime"="Czas nadawania"; "always.on"="Zawsze włączone"; +"ambient.lighting"="Ambient Lighting"; +"ambient.lighting.config"="Ambient Lighting Config"; "app.settings"="Ustawienia aplikacji"; "are.you.sure"="Jesteś pewny?"; "ascii.capable"="Zgodny z ASCII"; diff --git a/zh-Hans.lproj/Localizable.strings b/zh-Hans.lproj/Localizable.strings index cd4a522b..b2d86a68 100644 --- a/zh-Hans.lproj/Localizable.strings +++ b/zh-Hans.lproj/Localizable.strings @@ -12,6 +12,8 @@ "ago"="ago"; "airtime"="广播时间"; "always.on"="常亮"; +"ambient.lighting"="Ambient Lighting"; +"ambient.lighting.config"="Ambient Lighting Config"; "app.settings"="通用设置"; "are.you.sure"="是否确认?"; "ascii.capable"="ASCII Capable";