Add missing UI element descriptions for TTS.

custom
Tursiae 2 months ago
parent aa9e82b777
commit 9d5438e159
  1. 19
      lua/settings.lua

@ -223,7 +223,7 @@ settings.HeadphonesSettings = SettingsScreen:new {
SettingsScreen.create_ui(self) SettingsScreen.create_ui(self)
theme.set_subject(self.content:Label { theme.set_subject(self.content:Label {
text = "Maxiumum volume limit", text = "Maximum volume limit",
}, "settings_title") }, "settings_title")
local volume_chooser = self.content:Dropdown { local volume_chooser = self.content:Dropdown {
@ -237,6 +237,7 @@ settings.HeadphonesSettings = SettingsScreen:new {
local selection = volume_chooser:get('selected') + 1 local selection = volume_chooser:get('selected') + 1
volume.limit_db:set(limits[selection]) volume.limit_db:set(limits[selection])
end) end)
local volume_chooser_desc = widgets.Description(volume_chooser, "Maximum volume limit")
volume_chooser:focus() volume_chooser:focus()
theme.set_subject(self.content:Label { theme.set_subject(self.content:Label {
@ -371,6 +372,8 @@ settings.ThemeSettings = SettingsScreen:new {
options = options, options = options,
symbol = img.chevron, symbol = img.chevron,
} }
local theme_chooser_desc = widgets.Description(theme_chooser, "Theme")
theme_chooser:set({ selected = selected_idx }) theme_chooser:set({ selected = selected_idx })
theme_chooser:onevent(lvgl.EVENT.VALUE_CHANGED, function() theme_chooser:onevent(lvgl.EVENT.VALUE_CHANGED, function()
@ -440,11 +443,13 @@ settings.InputSettings = SettingsScreen:new {
text = "Control scheme", text = "Control scheme",
}, "settings_title") }, "settings_title")
local controls_chooser = make_scheme_control(self, controls.schemes(), controls.scheme) 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 { theme.set_subject(self.content:Label {
text = "Control scheme when locked", text = "Control scheme when locked",
}, "settings_title") }, "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() controls_chooser:focus()
@ -461,6 +466,7 @@ settings.InputSettings = SettingsScreen:new {
sensitivity:onevent(lvgl.EVENT.VALUE_CHANGED, function() sensitivity:onevent(lvgl.EVENT.VALUE_CHANGED, function()
controls.scroll_sensitivity:set(sensitivity:value() * slider_scale) controls.scroll_sensitivity:set(sensitivity:value() * slider_scale)
end) end)
local sensitivity_desc = widgets.Description(sensitivity, "Scroll Sensitivity")
end end
} }
@ -569,9 +575,15 @@ settings.DatabaseSettings = SettingsScreen:new {
auto_update_container:add_style(styles.list_item) auto_update_container:add_style(styles.list_item)
auto_update_container:Label { text = "Auto update", flex_grow = 1 } auto_update_container:Label { text = "Auto update", flex_grow = 1 }
local auto_update_sw = auto_update_container:Switch {} 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() auto_update_sw:onevent(lvgl.EVENT.VALUE_CHANGED, function()
database.auto_update:set(auto_update_sw:enabled()) 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) end)
local actions_container = self.content:Object { 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:add_style(styles.list_item)
fast_charge_container:Label { text = "Fast Charging", flex_grow = 1 } fast_charge_container:Label { text = "Fast Charging", flex_grow = 1 }
local fast_charge_sw = fast_charge_container:Switch {} 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() fast_charge_sw:onevent(lvgl.EVENT.VALUE_CHANGED, function()
power.fast_charge:set(fast_charge_sw:enabled()) power.fast_charge:set(fast_charge_sw:enabled())
@ -652,8 +665,10 @@ settings.PowerSettings = SettingsScreen:new {
power.fast_charge:bind(function(en) power.fast_charge:bind(function(en)
if en then if en then
fast_charge_sw:add_state(lvgl.STATE.CHECKED) fast_charge_sw:add_state(lvgl.STATE.CHECKED)
fast_charge_desc:set({text = "Disable Fast Charging"})
else else
fast_charge_sw:clear_state(lvgl.STATE.CHECKED) fast_charge_sw:clear_state(lvgl.STATE.CHECKED)
fast_charge_desc:set({text = "Enable Fast Charging"})
end end
end), end),
} }

Loading…
Cancel
Save