From 074021c5aa5530e6ea9f89d8f9922a6e15588c98 Mon Sep 17 00:00:00 2001 From: krolxon Date: Tue, 14 May 2024 01:38:48 +0530 Subject: [PATCH] change highlighting of current song in queue --- src/app.rs | 1 + src/ui.rs | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/app.rs b/src/app.rs index d004b8b..515b4ef 100755 --- a/src/app.rs +++ b/src/app.rs @@ -160,6 +160,7 @@ impl App { } self.update_queue(); + self.conn.update_status(); Ok(()) } diff --git a/src/ui.rs b/src/ui.rs index 5c7a23b..abea04d 100755 --- a/src/ui.rs +++ b/src/ui.rs @@ -90,7 +90,7 @@ fn draw_directory_browser(frame: &mut Frame, app: &mut App, size: Rect) { ]); if status { - row.magenta().bold() + row.bold() } else { row } @@ -168,17 +168,25 @@ fn draw_queue(frame: &mut Frame, app: &mut App, size: Rect) { let time = App::format_time(song.clone().duration.unwrap_or_else(|| Duration::new(0, 0))); let row = Row::new(vec![ - Cell::from(artist), - Cell::from(track.green()), - Cell::from(title), - Cell::from(album.cyan()), + Cell::from(artist.clone()), + Cell::from(track.clone().green()), + Cell::from(title.clone()), + Cell::from(album.clone().cyan()), Cell::from(time.to_string().magenta()), ]); let place = app.conn.current_song.place; if let Some(pos) = place { if i == pos.pos as usize { - row.magenta().bold() + let row = Row::new(vec![ + Cell::from(format!("> {}", artist)), + Cell::from(format!(" {}", track).green()), + Cell::from(format!(" {}", title)), + Cell::from(album.cyan()), + Cell::from(time.to_string().magenta()), + ]); + + row } else { row }