Add playing indicator arrow in playlist
All checks were successful
Build and Release / build-and-release (push) Successful in 54s
All checks were successful
Build and Release / build-and-release (push) Successful in 54s
Display a small arrow (▶) to the left of the currently playing track in the playlist, making it easier to identify which song is playing.
This commit is contained in:
parent
0ec328881a
commit
0fa26db116
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "cm-player"
|
||||
version = "0.1.27"
|
||||
version = "0.1.28"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
||||
@ -321,12 +321,17 @@ fn render_right_panel(frame: &mut Frame, state: &mut AppState, area: Rect, _tab_
|
||||
let is_selected = state.focus_playlist && idx == state.selected_playlist_index;
|
||||
let is_playing = idx == state.playlist_index;
|
||||
|
||||
// Add playing indicator arrow
|
||||
let indicator = if is_playing { "▶ " } else { " " };
|
||||
|
||||
// Build line with search highlighting if searching
|
||||
let line = if in_playlist_search && !playlist_search_query.is_empty() {
|
||||
Line::from(highlight_search_matches(&filename, &playlist_search_query, is_selected))
|
||||
let mut line_spans = vec![Span::raw(indicator)];
|
||||
if in_playlist_search && !playlist_search_query.is_empty() {
|
||||
line_spans.extend(highlight_search_matches(&filename, &playlist_search_query, is_selected));
|
||||
} else {
|
||||
Line::from(filename)
|
||||
};
|
||||
line_spans.push(Span::raw(filename));
|
||||
}
|
||||
let line = Line::from(line_spans);
|
||||
|
||||
let style = if is_selected && is_playing {
|
||||
// Both selected and playing: selection bar with bold
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user