rmptui074021c
change highlighting of current song in queue
+15 −6
2 files changed
- M src/app.rs +1 −0
- M src/ui.rs +14 −6
| @@ -160,6 +160,7 @@ impl App { | |||
| 160 | 160 | } | |
| 161 | 161 | ||
| 162 | 162 | self.update_queue(); | |
| 163 | + | self.conn.update_status(); | |
| 163 | 164 | Ok(()) | |
| 164 | 165 | } | |
| 165 | 166 | ||
| @@ -90,7 +90,7 @@ fn draw_directory_browser(frame: &mut Frame, app: &mut App, size: Rect) { | |||
| 90 | 90 | ]); | |
| 91 | 91 | ||
| 92 | 92 | if status { | |
| 93 | − | row.magenta().bold() | |
| 93 | + | row.bold() | |
| 94 | 94 | } else { | |
| 95 | 95 | row | |
| 96 | 96 | } | |
| @@ -168,17 +168,25 @@ fn draw_queue(frame: &mut Frame, app: &mut App, size: Rect) { | |||
| 168 | 168 | let time = App::format_time(song.clone().duration.unwrap_or_else(|| Duration::new(0, 0))); | |
| 169 | 169 | ||
| 170 | 170 | 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()), | |
| 175 | 175 | Cell::from(time.to_string().magenta()), | |
| 176 | 176 | ]); | |
| 177 | 177 | ||
| 178 | 178 | let place = app.conn.current_song.place; | |
| 179 | 179 | if let Some(pos) = place { | |
| 180 | 180 | 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 | |
| 182 | 190 | } else { | |
| 183 | 191 | row | |
| 184 | 192 | } | |