Use background colour for active selection

This commit is contained in:
Wojciech Kozlowski 2023-04-11 15:23:11 +02:00
parent 692b97a783
commit 611bca1c4a

View File

@ -38,13 +38,15 @@ pub fn render<B: Backend>(app: &mut App, frame: &mut Frame<'_, B>) {
frame.render_stateful_widget( frame.render_stateful_widget(
List::new(artists) List::new(artists)
.highlight_style(Style::default().add_modifier(Modifier::ITALIC)) .highlight_style(Style::default().bg(
.highlight_symbol(if let Category::Artist = app.get_active_category() { if let Category::Artist = app.get_active_category() {
">> " Color::DarkGray
} else { } else {
" > " Color::Black
}) },
.style(Style::default().fg(Color::Cyan).bg(Color::Black)) ))
.highlight_symbol(">> ")
.style(Style::default().fg(Color::White).bg(Color::Black))
.block( .block(
Block::default() Block::default()
.title(" Artists ") .title(" Artists ")
@ -74,13 +76,15 @@ pub fn render<B: Backend>(app: &mut App, frame: &mut Frame<'_, B>) {
frame.render_stateful_widget( frame.render_stateful_widget(
List::new(albums) List::new(albums)
.highlight_style(Style::default().add_modifier(Modifier::ITALIC)) .highlight_style(Style::default().bg(
.highlight_symbol(if let Category::Album = app.get_active_category() { if let Category::Album = app.get_active_category() {
">> " Color::DarkGray
} else { } else {
" > " Color::Black
}) },
.style(Style::default().fg(Color::Cyan).bg(Color::Black)) ))
.highlight_symbol(">> ")
.style(Style::default().fg(Color::White).bg(Color::Black))
.block( .block(
Block::default() Block::default()
.title(" Albums ") .title(" Albums ")
@ -107,7 +111,7 @@ pub fn render<B: Backend>(app: &mut App, frame: &mut Frame<'_, B>) {
Year: {}", Year: {}",
album.title, album.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(
Block::default() Block::default()
.title(" Album info ") .title(" Album info ")
@ -136,13 +140,15 @@ pub fn render<B: Backend>(app: &mut App, frame: &mut Frame<'_, B>) {
frame.render_stateful_widget( frame.render_stateful_widget(
List::new(tracks) List::new(tracks)
.highlight_style(Style::default().add_modifier(Modifier::ITALIC)) .highlight_style(Style::default().bg(
.highlight_symbol(if let Category::Track = app.get_active_category() { if let Category::Track = app.get_active_category() {
">> " Color::DarkGray
} else { } else {
" > " Color::Black
}) },
.style(Style::default().fg(Color::Cyan).bg(Color::Black)) ))
.highlight_symbol(">> ")
.style(Style::default().fg(Color::White).bg(Color::Black))
.block( .block(
Block::default() Block::default()
.title(" Tracks ") .title(" Tracks ")
@ -177,7 +183,7 @@ pub fn render<B: Backend>(app: &mut App, frame: &mut Frame<'_, B>) {
TrackFormat::Mp3 => "MP3", TrackFormat::Mp3 => "MP3",
}, },
)) ))
.style(Style::default().fg(Color::Cyan).bg(Color::Black)) .style(Style::default().fg(Color::White).bg(Color::Black))
.block( .block(
Block::default() Block::default()
.title(" Track info ") .title(" Track info ")