diff options
| author | ailurux <ailurux@noreply.codeberg.org> | 2025-04-14 04:17:19 +0000 |
|---|---|---|
| committer | ailurux <ailurux@noreply.codeberg.org> | 2025-04-14 04:17:19 +0000 |
| commit | 3804b2e2e89ceb368a92b5ecac4b9273f6c878fa (patch) | |
| tree | 442f06d9c07038fa1f3395c2ac5c09860e4a0130 | |
| parent | b87e991a1c2efd716974130a22f589fe1697a6fe (diff) | |
| parent | b8f13c804b8c253fa399e77d00c608b72a092fda (diff) | |
| download | tangara-fw-3804b2e2e89ceb368a92b5ecac4b9273f6c878fa.tar.gz | |
Merge pull request 'Current theme reloading' (#324) from ayumi/tangara-fw:reload-theme into main
Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/324
| -rw-r--r-- | lua/settings.lua | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/lua/settings.lua b/lua/settings.lua index d60ecfda..bd5be2ee 100644 --- a/lua/settings.lua +++ b/lua/settings.lua @@ -406,24 +406,38 @@ settings.ThemeSettings = SettingsScreen:new { selected_idx = idx end - local theme_chooser = self.content:Dropdown { + local theme_container = self.content:Object { + w = lvgl.PCT(100), + h = lvgl.SIZE_CONTENT, + flex = { + flex_direction = "column", + justify_content = "flex-start", + align_items = "space-evenly", + align_content = "flex-start", + }, + pad_row = 4, + } + theme_container:add_style(styles.list_item) + local theme_chooser = theme_container:Dropdown { 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() + local theme_reload = function() local option = theme_chooser:get('selected_str') local selectedTheme = themeOptions[option] if (selectedTheme) then theme.load_theme(tostring(selectedTheme)) backstack.reset(main_menu:new()) end - end) - + end + theme_chooser:set({ selected = selected_idx }) + theme_chooser:onevent(lvgl.EVENT.VALUE_CHANGED, theme_reload) theme_chooser:focus() + + local theme_reload_btn = theme_container:Button {} + theme_reload_btn:Label { text = "Reload" } + theme_reload_btn:onClicked(theme_reload) end } |
