diff options
| author | Tursiae <git@tursiae.org> | 2025-02-06 18:34:24 +1100 |
|---|---|---|
| committer | Tursiae <git@tursiae.org> | 2025-02-06 18:34:24 +1100 |
| commit | 9d5438e159f0a03d3e3bf77dd853d8b68a6e499c (patch) | |
| tree | 6831d570c464b1f3833a8a1048691c2515cb6210 /lua | |
| parent | aa9e82b777b019a7fb2316fd266ad50aaa9e19d0 (diff) | |
| download | tangara-fw-9d5438e159f0a03d3e3bf77dd853d8b68a6e499c.tar.gz | |
Add missing UI element descriptions for TTS.
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/settings.lua | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lua/settings.lua b/lua/settings.lua index da36ac8d..07f1e4d2 100644 --- a/lua/settings.lua +++ b/lua/settings.lua @@ -223,7 +223,7 @@ settings.HeadphonesSettings = SettingsScreen:new { SettingsScreen.create_ui(self) theme.set_subject(self.content:Label { - text = "Maxiumum volume limit", + text = "Maximum volume limit", }, "settings_title") local volume_chooser = self.content:Dropdown { @@ -237,6 +237,7 @@ settings.HeadphonesSettings = SettingsScreen:new { local selection = volume_chooser:get('selected') + 1 volume.limit_db:set(limits[selection]) end) + local volume_chooser_desc = widgets.Description(volume_chooser, "Maximum volume limit") volume_chooser:focus() theme.set_subject(self.content:Label { @@ -371,6 +372,8 @@ settings.ThemeSettings = SettingsScreen:new { options = options, symbol = img.chevron, } + + local theme_chooser_desc = widgets.Description(theme_chooser, "Theme") theme_chooser:set({ selected = selected_idx }) theme_chooser:onevent(lvgl.EVENT.VALUE_CHANGED, function() @@ -440,11 +443,13 @@ settings.InputSettings = SettingsScreen:new { text = "Control scheme", }, "settings_title") local controls_chooser = make_scheme_control(self, controls.schemes(), controls.scheme) + local controls_chooser_desc = widgets.Description(controls_chooser, "Control scheme") theme.set_subject(self.content:Label { text = "Control scheme when locked", }, "settings_title") - make_scheme_control(self, controls.locked_schemes(), controls.locked_scheme) + local controls_locked = make_scheme_control(self, controls.locked_schemes(), controls.locked_scheme) + local controls_locked_desc = widgets.Description(controls_locked, "Control scheme when locked") controls_chooser:focus() @@ -461,6 +466,7 @@ settings.InputSettings = SettingsScreen:new { sensitivity:onevent(lvgl.EVENT.VALUE_CHANGED, function() controls.scroll_sensitivity:set(sensitivity:value() * slider_scale) end) + local sensitivity_desc = widgets.Description(sensitivity, "Scroll Sensitivity") end } @@ -569,9 +575,15 @@ settings.DatabaseSettings = SettingsScreen:new { auto_update_container:add_style(styles.list_item) auto_update_container:Label { text = "Auto update", flex_grow = 1 } local auto_update_sw = auto_update_container:Switch {} + local auto_update_desc = widgets.Description(auto_update_sw, "Auto update") auto_update_sw:onevent(lvgl.EVENT.VALUE_CHANGED, function() database.auto_update:set(auto_update_sw:enabled()) + if auto_update_sw:enabled() then + auto_update_desc:set({text = "Disable auto-update"}) + else + auto_update_desc:set({text = "Enable auto-update"}) + end end) local actions_container = self.content:Object { @@ -643,6 +655,7 @@ settings.PowerSettings = SettingsScreen:new { fast_charge_container:add_style(styles.list_item) fast_charge_container:Label { text = "Fast Charging", flex_grow = 1 } local fast_charge_sw = fast_charge_container:Switch {} + local fast_charge_desc = widgets.Description(fast_charge_sw, "Fast Charging") fast_charge_sw:onevent(lvgl.EVENT.VALUE_CHANGED, function() power.fast_charge:set(fast_charge_sw:enabled()) @@ -652,8 +665,10 @@ settings.PowerSettings = SettingsScreen:new { power.fast_charge:bind(function(en) if en then fast_charge_sw:add_state(lvgl.STATE.CHECKED) + fast_charge_desc:set({text = "Disable Fast Charging"}) else fast_charge_sw:clear_state(lvgl.STATE.CHECKED) + fast_charge_desc:set({text = "Enable Fast Charging"}) end end), } |
