highlight current playing songs in lists

This commit is contained in:
krolxon 2024-05-10 22:50:56 +05:30
parent 0c8cfe3a9c
commit 6af7553fc8
1 changed files with 3 additions and 2 deletions

View File

@ -145,7 +145,7 @@ fn draw_directory_browser(frame: &mut Frame, app: &mut App, size: Rect) {
/// draws playing queue
fn draw_queue(frame: &mut Frame, app: &mut App, size: Rect) {
let rows = app.queue_list.list.iter().map(|song| {
let rows = app.queue_list.list.iter().enumerate().map(|(i, song)| {
// metadata
let title = song.clone().title.unwrap_or_else(|| song.clone().file);
let artist = song.clone().artist.unwrap_or_default().cyan();
@ -175,7 +175,8 @@ fn draw_queue(frame: &mut Frame, app: &mut App, size: Rect) {
Cell::from(time.to_string().magenta()),
]);
if song.file.contains(&app.conn.current_song.file) {
let pos = app.conn.current_song.place.unwrap_or_default().pos;
if i == pos as usize {
row.magenta().bold()
} else {
row