summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcooljqln <cooljqln@noreply.codeberg.org>2025-02-03 05:49:42 +0000
committercooljqln <cooljqln@noreply.codeberg.org>2025-02-03 05:49:42 +0000
commit28846b989b75ca6fe513462c209ce95bce2a46b7 (patch)
treed6ca8026c16558f3426885e91b3cd5617b33c314
parent6c323f0fd075beb406df04d444fc4029b733ceb4 (diff)
parent1c0170254cd0653cf089ba03b6a06fc9786e357a (diff)
downloadtangara-fw-28846b989b75ca6fe513462c209ce95bce2a46b7.tar.gz
Merge pull request 'UI tweaks' (#229) from schrockwell/tangara-fw:ui-tweaks-pr into main
Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/229
-rw-r--r--.gitignore1
-rw-r--r--lua/main_menu.lua6
-rw-r--r--lua/playing.lua2
-rw-r--r--lua/settings.lua14
4 files changed, 19 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
index 7776977d..1ff0f7b4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,6 +12,7 @@ sdkconfig.old
.vscode
compile_commands.json
warnings.txt
+.DS_Store
doc/
diff --git a/lua/main_menu.lua b/lua/main_menu.lua
index cc7874d7..3b512d72 100644
--- a/lua/main_menu.lua
+++ b/lua/main_menu.lua
@@ -56,7 +56,6 @@ return widgets.MenuScreen:new {
now_playing:onClicked(function() backstack.push(playing:new()) end)
- local has_focus = false
local track_duration = nil
self.bindings = self.bindings + {
@@ -72,7 +71,6 @@ return widgets.MenuScreen:new {
now_playing:add_flag(lvgl.FLAG.HIDDEN)
return
else
- has_focus = true
now_playing:clear_flag(lvgl.FLAG.HIDDEN)
end
title:set { text = track.title }
@@ -140,6 +138,10 @@ return widgets.MenuScreen:new {
local function hide_no_indexes()
no_indexes_container:add_flag(lvgl.FLAG.HIDDEN)
indexes_list:clear_flag(lvgl.FLAG.HIDDEN)
+
+ if indexes[1] then
+ indexes[1].object:focus()
+ end
end
local function update_visible_indexes()
diff --git a/lua/playing.lua b/lua/playing.lua
index 08cdaaa2..9391a85c 100644
--- a/lua/playing.lua
+++ b/lua/playing.lua
@@ -276,7 +276,7 @@ return screen:new {
if queue.loading:get() then
title:set { text = "Loading..." }
else
- title:set{text=""}
+ title:set{ text = "Not Playing" }
end
album:set{text=""}
artist:set{text=""}
diff --git a/lua/settings.lua b/lua/settings.lua
index c0e7c23e..4f1e36f8 100644
--- a/lua/settings.lua
+++ b/lua/settings.lua
@@ -93,6 +93,7 @@ settings.BluetoothSettings = SettingsScreen:new {
local enabled = enable_sw:enabled()
bluetooth.enabled:set(enabled)
end)
+ enable_sw:focus()
self.bindings = self.bindings + {
bluetooth.enabled:bind(function(en)
@@ -232,6 +233,7 @@ settings.HeadphonesSettings = SettingsScreen:new {
local selection = volume_chooser:get('selected') + 1
volume.limit_db:set(limits[selection])
end)
+ volume_chooser:focus()
theme.set_subject(self.content:Label {
text = "Left/Right balance",
@@ -304,6 +306,7 @@ settings.DisplaySettings = SettingsScreen:new {
brightness:onevent(lvgl.EVENT.VALUE_CHANGED, function()
display.brightness:set(brightness:value())
end)
+ brightness:focus()
self.bindings = self.bindings + {
display.brightness:bind(function(b)
@@ -372,6 +375,8 @@ settings.ThemeSettings = SettingsScreen:new {
backstack.reset(main_menu:new())
end
end)
+
+ theme_chooser:focus()
end
}
@@ -419,6 +424,8 @@ settings.InputSettings = SettingsScreen:new {
controls.scheme:set(scheme)
end)
+ controls_chooser:focus()
+
theme.set_subject(self.content:Label {
text = "Scroll Sensitivity",
}, "settings_title")
@@ -483,6 +490,7 @@ settings.MassStorageSettings = SettingsScreen:new {
end
bind_switch()
end)
+ enable_sw:focus()
self.bindings = self.bindings + {
usb.msc_enabled:bind(bind_switch),
@@ -560,6 +568,7 @@ settings.DatabaseSettings = SettingsScreen:new {
update:onClicked(function()
database.update()
end)
+ update:focus()
self.bindings = self.bindings + {
database.auto_update:bind(function(en)
@@ -841,10 +850,11 @@ settings.Root = widgets.MenuScreen:new {
end)
end
item:add_style(styles.list_item)
+ return item
end
local audio_section = section("Audio")
- submenu("Bluetooth", settings.BluetoothSettings, audio_section)
+ local first_item = submenu("Bluetooth", settings.BluetoothSettings, audio_section)
submenu("Headphones", settings.HeadphonesSettings)
section("Interface")
@@ -863,6 +873,8 @@ settings.Root = widgets.MenuScreen:new {
submenu("Firmware", settings.FirmwareSettings)
submenu("Licenses", settings.LicensesScreen)
submenu("Regulatory", settings.RegulatoryScreen)
+
+ first_item:focus()
end
}