Krolyxon
Commit 2aa98fa

rmptui2aa98fa

queue: highlight current playing song initially

Author
krolxon
Date
2024-05-30 16:18 +0530
Parent
06da8f0
Commit
2aa98fa9e28ad2d50906dfd59f126da4287da6bc

+5 −0

1 file changed

  1. M src/main.rs +5 −0
M src/main.rs View
@@ -25,6 +25,11 @@ fn main() -> AppResult<()> {
2525 // initial directory read
2626 app.browser.update_directory(&mut app.conn)?;
2727
28+ // initially set the queue's highlighted item to the current playing item
29+ if let Ok(item) = app.conn.conn.currentsong() {
30+ app.queue_list.index = item.unwrap_or_default().place.unwrap_or_default().pos as usize;
31+ }
32+
2833 while app.running {
2934 tui.draw(&mut app)?;
3035 match tui.events.next()? {