From 6ae0aca8680d2ffd36442e58e5ab8b1d1b083d15 Mon Sep 17 00:00:00 2001 From: krolxon Date: Thu, 30 May 2024 16:18:54 +0530 Subject: [PATCH] queue: highlight current playing song initially --- src/main.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.rs b/src/main.rs index 0b856b4..17fd053 100755 --- a/src/main.rs +++ b/src/main.rs @@ -25,6 +25,11 @@ fn main() -> AppResult<()> { // initial directory read app.browser.update_directory(&mut app.conn)?; + // initially set the queue's highlighted item to the current playing item + if let Ok(item) = app.conn.conn.currentsong() { + app.queue_list.index = item.unwrap_or_default().place.unwrap_or_default().pos as usize; + } + while app.running { tui.draw(&mut app)?; match tui.events.next()? {