Skip to content

Commit

Permalink
add new themable color for selected + playing track
Browse files Browse the repository at this point in the history
fixes #166
  • Loading branch information
hrkfdn committed Apr 9, 2020
1 parent b556635 commit 510f1ff
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down
4 changes: 4 additions & 0 deletions src/theme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down
2 changes: 1 addition & 1 deletion src/ui/listview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
};
Expand Down

0 comments on commit 510f1ff

Please sign in to comment.