summaryrefslogtreecommitdiff
path: root/lua/playing.lua
diff options
context:
space:
mode:
authorailurux <ailuruxx@gmail.com>2025-01-17 02:24:05 +0000
committercooljqln <cooljqln@noreply.codeberg.org>2025-01-17 02:24:05 +0000
commit61cc7209ef69e6142242fd67d8c484bc1c976dbe (patch)
treee473382ee9991d5970a99818e3e0392ad5fd8700 /lua/playing.lua
parent0180c9311db13281808976c2cc5e53994da4432f (diff)
downloadtangara-fw-61cc7209ef69e6142242fd67d8c484bc1c976dbe.tar.gz
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 <ailuruxx@gmail.com> Co-committed-by: ailurux <ailuruxx@gmail.com>
Diffstat (limited to 'lua/playing.lua')
-rw-r--r--lua/playing.lua22
1 files changed, 14 insertions, 8 deletions
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)