From 0fa26db1161a6d4abc06c4ad5c4b6be4b093aa06 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Fri, 12 Dec 2025 12:57:12 +0100 Subject: [PATCH] Add playing indicator arrow in playlist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Display a small arrow (▶) to the left of the currently playing track in the playlist, making it easier to identify which song is playing. --- Cargo.toml | 2 +- src/ui/mod.rs | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 86d8dd9..839e710 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-player" -version = "0.1.27" +version = "0.1.28" edition = "2021" [dependencies] diff --git a/src/ui/mod.rs b/src/ui/mod.rs index 0e3c6b1..2733739 100644 --- a/src/ui/mod.rs +++ b/src/ui/mod.rs @@ -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