diff options
| author | ailurux <ailuruxx@gmail.com> | 2025-01-17 12:17:05 +1100 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2025-01-17 13:42:17 +1100 |
| commit | 27fa107b861091cd08262fbcba061611a6df6d87 (patch) | |
| tree | 787c8cdf690fa1f64dad711492370c1078c375be /lua/playing_menu.lua | |
| parent | 61cc7209ef69e6142242fd67d8c484bc1c976dbe (diff) | |
| download | tangara-fw-27fa107b861091cd08262fbcba061611a6df6d87.tar.gz | |
Don't show "go to" buttons if no track or if we don't know the artist/album
Diffstat (limited to 'lua/playing_menu.lua')
| -rw-r--r-- | lua/playing_menu.lua | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lua/playing_menu.lua b/lua/playing_menu.lua index 8ab2961b..2b5a6c98 100644 --- a/lua/playing_menu.lua +++ b/lua/playing_menu.lua @@ -131,8 +131,23 @@ return screen:new { self.bindings = self.bindings + { playback.track:bind(function(track) + if not track then + artist_btn:add_flag(lvgl.FLAG.HIDDEN) + album_btn:add_flag(lvgl.FLAG.HIDDEN) + return + end current_artist = track.artist + if not current_artist then + artist_btn:add_flag(lvgl.FLAG.HIDDEN) + else + artist_btn:clear_flag(lvgl.FLAG.HIDDEN) + end current_album = track.album + if not current_album then + album_btn:add_flag(lvgl.FLAG.HIDDEN) + else + album_btn:clear_flag(lvgl.FLAG.HIDDEN) + end album_artist = track.album_artist end), } |
