rmptui2aa98fa
queue: highlight current playing song initially
+5 −0
1 file changed
- M src/main.rs +5 −0
| @@ -25,6 +25,11 @@ fn main() -> AppResult<()> { | |||
| 25 | 25 | // initial directory read | |
| 26 | 26 | app.browser.update_directory(&mut app.conn)?; | |
| 27 | 27 | ||
| 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 | + | ||
| 28 | 33 | while app.running { | |
| 29 | 34 | tui.draw(&mut app)?; | |
| 30 | 35 | match tui.events.next()? { | |