diff options
| author | Rockwell Schrock <rockwell@schrock.me> | 2025-02-01 09:42:18 -0500 |
|---|---|---|
| committer | Rockwell Schrock <rockwell@schrock.me> | 2025-02-01 12:44:59 -0500 |
| commit | 15806716c57d78f3b43ff85caa72b83f6057dfc9 (patch) | |
| tree | a77fa158b4d7d1d1a9b36b1dc31260c7582845bc /lua/main_menu.lua | |
| parent | 8b12310990bbf03835bd910070841977cd57d22f (diff) | |
| download | tangara-fw-15806716c57d78f3b43ff85caa72b83f6057dfc9.tar.gz | |
Autofocus the first index on the main menu
Diffstat (limited to 'lua/main_menu.lua')
| -rw-r--r-- | lua/main_menu.lua | 6 |
1 files changed, 4 insertions, 2 deletions
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() |
