From 61cc7209ef69e6142242fd67d8c484bc1c976dbe Mon Sep 17 00:00:00 2001 From: ailurux Date: Fri, 17 Jan 2025 02:24:05 +0000 Subject: ailurux/now-playing-menu (#184) Overflow menu for the now playing screen. New home for the info screen here. Adds quick navigation to current album or artist (thanks tjk!) and clear queue button. Also fixed up the way the now playing screen looks when queue is cleared (remove previous duration and don't show "loading" if nothing is actively loading). Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/184 Co-authored-by: ailurux Co-committed-by: ailurux --- lua/playing.lua | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'lua/playing.lua') diff --git a/lua/playing.lua b/lua/playing.lua index cee25c21..08cdaaa2 100644 --- a/lua/playing.lua +++ b/lua/playing.lua @@ -10,7 +10,7 @@ local playback = require("playback") local queue = require("queue") local screen = require("screen") local theme = require("theme") -local track_info = require("track_info") +local playing_menu = require("playing_menu") local img = require("images") @@ -235,13 +235,13 @@ return screen:new { theme.set_subject(shuffle_btn, icon_enabled_class) local shuffle_desc = widgets.Description(shuffle_btn) - local info_btn = controls:Button {} - info_btn:onClicked(function() - backstack.push(track_info:new()) + local menu_btn = controls:Button {} + menu_btn:onClicked(function() + backstack.push(playing_menu:new()) end) - local info_img = info_btn:Image { src = img.info } - theme.set_subject(info_btn, icon_enabled_class) - local info_desc = widgets.Description(info_btn, "Track info") + local menu_img = menu_btn:Image { src = img.menu } + theme.set_subject(menu_btn, icon_enabled_class) + local menu_desc = widgets.Description(menu_btn, "Track info") controls:Object({ flex_grow = 1, h = 1 }) -- spacer @@ -273,9 +273,15 @@ return screen:new { end), queue.ready:bind(function(ready) if not ready then - title:set { text = "Loading..." } + if queue.loading:get() then + title:set { text = "Loading..." } + else + title:set{text=""} + end album:set{text=""} artist:set{text=""} + cur_time:set { text = format_time(0) } + end_time:set { text = format_time(0) } end end), playback.track:bind(function(track) -- cgit v1.2.3