add new themable color for selected + playing track

fixes #166
This commit is contained in:
Henrik Friedrichsen
2020-04-09 23:50:56 +02:00
parent b5566351b5
commit 510f1ff6ad
4 changed files with 7 additions and 1 deletions

View File

@@ -158,6 +158,7 @@ primary = "light white"
secondary = "light black"
title = "green"
playing = "green"
playing_selected = "light green"
playing_bg = "black"
highlight = "light white"
highlight_bg = "#484848"

View File

@@ -29,6 +29,7 @@ pub struct ConfigTheme {
pub secondary: Option<String>,
pub title: Option<String>,
pub playing: Option<String>,
pub playing_selected: Option<String>,
pub playing_bg: Option<String>,
pub highlight: Option<String>,
pub highlight_bg: Option<String>,

View File

@@ -27,6 +27,10 @@ pub fn load(cfg: &Config) -> Theme {
palette[Tertiary] = load_color!(cfg, highlight, TerminalDefault);
palette[Highlight] = load_color!(cfg, highlight_bg, Dark(Red));
palette.set_color("playing", load_color!(cfg, playing, Dark(Blue)));
palette.set_color(
"playing_selected",
load_color!(cfg, playing_selected, Light(Blue)),
);
palette.set_color("playing_bg", load_color!(cfg, playing_bg, TerminalDefault));
palette.set_color("error", load_color!(cfg, error, TerminalDefault));
palette.set_color("error_bg", load_color!(cfg, error_bg, Dark(Red)));

View File

@@ -175,7 +175,7 @@ impl<I: ListItem> View for ListView<I> {
let style = if self.selected == i {
let fg = if item.is_playing(self.queue.clone()) {
*printer.theme.palette.custom("playing").unwrap()
*printer.theme.palette.custom("playing_selected").unwrap()
} else {
PaletteColor::Tertiary.resolve(&printer.theme.palette)
};