Krolyxon
Commit 074021c

rmptui074021c

change highlighting of current song in queue

Author
krolxon
Date
2024-05-14 01:38 +0530
Parent
4203896
Commit
074021c5aa5530e6ea9f89d8f9922a6e15588c98

+15 −6

2 files changed

  1. M src/app.rs +1 −0
  2. M src/ui.rs +14 −6
M src/app.rs View
@@ -160,6 +160,7 @@ impl App {
160160 }
161161
162162 self.update_queue();
163+ self.conn.update_status();
163164 Ok(())
164165 }
165166
M src/ui.rs View
@@ -90,7 +90,7 @@ fn draw_directory_browser(frame: &mut Frame, app: &mut App, size: Rect) {
9090 ]);
9191
9292 if status {
93− row.magenta().bold()
93+ row.bold()
9494 } else {
9595 row
9696 }
@@ -168,17 +168,25 @@ fn draw_queue(frame: &mut Frame, app: &mut App, size: Rect) {
168168 let time = App::format_time(song.clone().duration.unwrap_or_else(|| Duration::new(0, 0)));
169169
170170 let row = Row::new(vec![
171− Cell::from(artist),
172− Cell::from(track.green()),
173− Cell::from(title),
174− Cell::from(album.cyan()),
171+ Cell::from(artist.clone()),
172+ Cell::from(track.clone().green()),
173+ Cell::from(title.clone()),
174+ Cell::from(album.clone().cyan()),
175175 Cell::from(time.to_string().magenta()),
176176 ]);
177177
178178 let place = app.conn.current_song.place;
179179 if let Some(pos) = place {
180180 if i == pos.pos as usize {
181− row.magenta().bold()
181+ let row = Row::new(vec![
182+ Cell::from(format!("> {}", artist)),
183+ Cell::from(format!(" {}", track).green()),
184+ Cell::from(format!(" {}", title)),
185+ Cell::from(album.cyan()),
186+ Cell::from(time.to_string().magenta()),
187+ ]);
188+
189+ row
182190 } else {
183191 row
184192 }