From 611bca1c4ad1f963ee68e97d66dedce4ad2e6dbf Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Tue, 11 Apr 2023 15:23:11 +0200 Subject: [PATCH] Use background colour for active selection --- src/tui/ui.rs | 52 ++++++++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/src/tui/ui.rs b/src/tui/ui.rs index c986d5c..2295f2e 100644 --- a/src/tui/ui.rs +++ b/src/tui/ui.rs @@ -38,13 +38,15 @@ pub fn render(app: &mut App, frame: &mut Frame<'_, B>) { frame.render_stateful_widget( List::new(artists) - .highlight_style(Style::default().add_modifier(Modifier::ITALIC)) - .highlight_symbol(if let Category::Artist = app.get_active_category() { - ">> " - } else { - " > " - }) - .style(Style::default().fg(Color::Cyan).bg(Color::Black)) + .highlight_style(Style::default().bg( + if let Category::Artist = app.get_active_category() { + Color::DarkGray + } else { + Color::Black + }, + )) + .highlight_symbol(">> ") + .style(Style::default().fg(Color::White).bg(Color::Black)) .block( Block::default() .title(" Artists ") @@ -74,13 +76,15 @@ pub fn render(app: &mut App, frame: &mut Frame<'_, B>) { frame.render_stateful_widget( List::new(albums) - .highlight_style(Style::default().add_modifier(Modifier::ITALIC)) - .highlight_symbol(if let Category::Album = app.get_active_category() { - ">> " - } else { - " > " - }) - .style(Style::default().fg(Color::Cyan).bg(Color::Black)) + .highlight_style(Style::default().bg( + if let Category::Album = app.get_active_category() { + Color::DarkGray + } else { + Color::Black + }, + )) + .highlight_symbol(">> ") + .style(Style::default().fg(Color::White).bg(Color::Black)) .block( Block::default() .title(" Albums ") @@ -107,7 +111,7 @@ pub fn render(app: &mut App, frame: &mut Frame<'_, B>) { Year: {}", album.title, album.year, )) - .style(Style::default().fg(Color::Cyan).bg(Color::Black)) + .style(Style::default().fg(Color::White).bg(Color::Black)) .block( Block::default() .title(" Album info ") @@ -136,13 +140,15 @@ pub fn render(app: &mut App, frame: &mut Frame<'_, B>) { frame.render_stateful_widget( List::new(tracks) - .highlight_style(Style::default().add_modifier(Modifier::ITALIC)) - .highlight_symbol(if let Category::Track = app.get_active_category() { - ">> " - } else { - " > " - }) - .style(Style::default().fg(Color::Cyan).bg(Color::Black)) + .highlight_style(Style::default().bg( + if let Category::Track = app.get_active_category() { + Color::DarkGray + } else { + Color::Black + }, + )) + .highlight_symbol(">> ") + .style(Style::default().fg(Color::White).bg(Color::Black)) .block( Block::default() .title(" Tracks ") @@ -177,7 +183,7 @@ pub fn render(app: &mut App, frame: &mut Frame<'_, B>) { TrackFormat::Mp3 => "MP3", }, )) - .style(Style::default().fg(Color::Cyan).bg(Color::Black)) + .style(Style::default().fg(Color::White).bg(Color::Black)) .block( Block::default() .title(" Track info ")