aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkrolxon <krolyxon@tutanota.com>2024-05-14 01:38:48 +0530
committerkrolxon <krolyxon@tutanota.com>2024-05-14 01:38:48 +0530
commit074021c5aa5530e6ea9f89d8f9922a6e15588c98 (patch)
tree5f37344cdfb47ad16ebd84c5eb6b95929e2c4bbd
parent420389664b3aef6140715312fbbae7cc6851cb0e (diff)
change highlighting of current song in queue
-rwxr-xr-xsrc/app.rs1
-rwxr-xr-xsrc/ui.rs20
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
}