From 50d6efada5bfa2b23a3e1830051475e95d33eb53 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Tue, 10 Sep 2024 14:42:40 +1000 Subject: Use '/sd' instead of '/sdcard' for accessing the sd card it's cleaner --- lua/settings.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lua/settings.lua') diff --git a/lua/settings.lua b/lua/settings.lua index 9b77274d..ae9a6e6d 100644 --- a/lua/settings.lua +++ b/lua/settings.lua @@ -319,7 +319,7 @@ local ThemeSettings = SettingsScreen:new { local theme_dir_iter = filesystem.iterator("/.themes/") for dir in theme_dir_iter do local theme_name = tostring(dir):match("(.+).lua$") - themeOptions[theme_name] = "/sdcard/.themes/" .. theme_name .. ".lua" + themeOptions[theme_name] = "/sd/.themes/" .. theme_name .. ".lua" end local saved_theme = theme.theme_filename(); -- cgit v1.2.3 From 1f5ce2438982860529e43f8ddf093164b920724a Mon Sep 17 00:00:00 2001 From: ailurux Date: Tue, 10 Sep 2024 15:58:03 +1000 Subject: Rename set_style to set_subject --- lua/settings.lua | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'lua/settings.lua') diff --git a/lua/settings.lua b/lua/settings.lua index ae9a6e6d..654ae62c 100644 --- a/lua/settings.lua +++ b/lua/settings.lua @@ -102,7 +102,7 @@ local BluetoothSettings = SettingsScreen:new { text = "", pad_bottom = 1, } - theme.set_style(paired_label, "settings_title") + theme.set_subject(paired_label, "settings_title") self.bindings = self.bindings + { bluetooth.connecting:bind(function(conn) @@ -152,7 +152,7 @@ local BluetoothSettings = SettingsScreen:new { end), } - theme.set_style(self.content:Label { + theme.set_subject(self.content:Label { text = "Known Devices", pad_bottom = 1, }, "settings_title") @@ -206,7 +206,7 @@ local HeadphonesSettings = SettingsScreen:new { create_ui = function(self) SettingsScreen.create_ui(self) - theme.set_style(self.content:Label { + theme.set_subject(self.content:Label { text = "Maxiumum volume limit", }, "settings_title") @@ -221,7 +221,7 @@ local HeadphonesSettings = SettingsScreen:new { volume.limit_db:set(limits[selection]) end) - theme.set_style(self.content:Label { + theme.set_subject(self.content:Label { text = "Left/Right balance", }, "settings_title") @@ -282,7 +282,7 @@ local DisplaySettings = SettingsScreen:new { } brightness_title:Label { text = "Brightness", flex_grow = 1 } local brightness_pct = brightness_title:Label {} - theme.set_style(brightness_pct, "settings_title") + theme.set_subject(brightness_pct, "settings_title") local brightness = self.content:Slider { w = lvgl.PCT(100), @@ -306,7 +306,7 @@ local ThemeSettings = SettingsScreen:new { create_ui = function(self) SettingsScreen.create_ui(self) - theme.set_style(self.content:Label { + theme.set_subject(self.content:Label { text = "Theme", }, "settings_title") @@ -365,7 +365,7 @@ local InputSettings = SettingsScreen:new { create_ui = function(self) SettingsScreen.create_ui(self) - theme.set_style(self.content:Label { + theme.set_subject(self.content:Label { text = "Control scheme", }, "settings_title") @@ -403,7 +403,7 @@ local InputSettings = SettingsScreen:new { controls.scheme:set(scheme) end) - theme.set_style(self.content:Label { + theme.set_subject(self.content:Label { text = "Scroll Sensitivity", }, "settings_title") @@ -761,7 +761,7 @@ local RegulatoryScreen = SettingsScreen:new { pad_top = 4, pad_column = 4, } - theme.set_style(logo_container, "regulatory_icons") + theme.set_subject(logo_container, "regulatory_icons") button_container:add_style(styles.list_item) logo_container:Image { src = "//lua/img/ce.png" } @@ -785,7 +785,7 @@ return widgets.MenuScreen:new { text = name, pad_left = 4, } - theme.set_style(elem, "settings_title") + theme.set_subject(elem, "settings_title") end local function submenu(name, class) -- cgit v1.2.3 From 9a47e43ab72daa96bfb3e95e95c30e5703f39397 Mon Sep 17 00:00:00 2001 From: ailurux Date: Thu, 12 Sep 2024 05:20:07 +0000 Subject: daniel/theme-tweaks (#102) - Multiple improvements + fixes - Add charge outline icon for improving readability with monochromatic themes - Add a chevron icon and update existing dropdown menus - Rename `set_style` to `set_subject` for disambiguation with lvgl's Style type Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/102 Reviewed-by: cooljqln Co-authored-by: ailurux Co-committed-by: ailurux --- lua/settings.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lua/settings.lua') diff --git a/lua/settings.lua b/lua/settings.lua index 654ae62c..b23f9756 100644 --- a/lua/settings.lua +++ b/lua/settings.lua @@ -12,6 +12,7 @@ local database = require("database") local usb = require("usb") local font = require("font") local main_menu = require("main_menu") +local img = require("images") local SettingsScreen = widgets.MenuScreen:new { show_back = true, @@ -213,6 +214,7 @@ local HeadphonesSettings = SettingsScreen:new { local volume_chooser = self.content:Dropdown { options = "Line Level (-10 dB)\nCD Level (+6 dB)\nMaximum (+10dB)", selected = 1, + symbol = img.chevron, } local limits = { -10, 6, 10 } volume_chooser:onevent(lvgl.EVENT.VALUE_CHANGED, function() @@ -319,7 +321,9 @@ local ThemeSettings = SettingsScreen:new { local theme_dir_iter = filesystem.iterator("/.themes/") for dir in theme_dir_iter do local theme_name = tostring(dir):match("(.+).lua$") - themeOptions[theme_name] = "/sd/.themes/" .. theme_name .. ".lua" + if (theme_name) then + themeOptions[theme_name] = "/sd/.themes/" .. theme_name .. ".lua" + end end local saved_theme = theme.theme_filename(); @@ -346,6 +350,7 @@ local ThemeSettings = SettingsScreen:new { local theme_chooser = self.content:Dropdown { options = options, + symbol = img.chevron, } theme_chooser:set({selected = selected_idx}) @@ -388,6 +393,7 @@ local InputSettings = SettingsScreen:new { local controls_chooser = self.content:Dropdown { options = options, + symbol = img.chevron, } self.bindings = self.bindings + { -- cgit v1.2.3