rmptui6af7553
highlight current playing songs in lists
+3 −2
1 file changed
- M src/ui.rs +3 −2
| @@ -145,7 +145,7 @@ fn draw_directory_browser(frame: &mut Frame, app: &mut App, size: Rect) { | |||
| 145 | 145 | ||
| 146 | 146 | /// draws playing queue | |
| 147 | 147 | fn draw_queue(frame: &mut Frame, app: &mut App, size: Rect) { | |
| 148 | − | let rows = app.queue_list.list.iter().map(|song| { | |
| 148 | + | let rows = app.queue_list.list.iter().enumerate().map(|(i, song)| { | |
| 149 | 149 | // metadata | |
| 150 | 150 | let title = song.clone().title.unwrap_or_else(|| song.clone().file); | |
| 151 | 151 | let artist = song.clone().artist.unwrap_or_default().cyan(); | |
| @@ -175,7 +175,8 @@ fn draw_queue(frame: &mut Frame, app: &mut App, size: Rect) { | |||
| 175 | 175 | Cell::from(time.to_string().magenta()), | |
| 176 | 176 | ]); | |
| 177 | 177 | ||
| 178 | − | if song.file.contains(&app.conn.current_song.file) { | |
| 178 | + | let pos = app.conn.current_song.place.unwrap_or_default().pos; | |
| 179 | + | if i == pos as usize { | |
| 179 | 180 | row.magenta().bold() | |
| 180 | 181 | } else { | |
| 181 | 182 | row | |