Fix: align with color palette of Cursive
Should make context menus (`SelectView`) look like ncspot's `ListView`. Fixes #431
This commit is contained in:
@@ -31,7 +31,7 @@ pub fn load(theme_cfg: &Option<ConfigTheme>) -> Theme {
|
||||
palette[Primary] = load_color!(theme_cfg, primary, TerminalDefault);
|
||||
palette[Secondary] = load_color!(theme_cfg, secondary, Dark(Blue));
|
||||
palette[TitlePrimary] = load_color!(theme_cfg, title, Dark(Red));
|
||||
palette[Tertiary] = load_color!(theme_cfg, highlight, TerminalDefault);
|
||||
palette[HighlightText] = load_color!(theme_cfg, highlight, Dark(White));
|
||||
palette[Highlight] = load_color!(theme_cfg, highlight_bg, Dark(Red));
|
||||
palette.set_color("playing", load_color!(theme_cfg, playing, Dark(Blue)));
|
||||
palette.set_color(
|
||||
|
||||
@@ -176,15 +176,14 @@ impl<I: ListItem> View for ListView<I> {
|
||||
&& self.queue.get_current_index() == Some(i);
|
||||
|
||||
let style = if self.selected == i {
|
||||
let fg = if currently_playing {
|
||||
*printer.theme.palette.custom("playing_selected").unwrap()
|
||||
if currently_playing {
|
||||
ColorStyle::new(
|
||||
*printer.theme.palette.custom("playing_selected").unwrap(),
|
||||
ColorType::Palette(PaletteColor::Highlight),
|
||||
)
|
||||
} else {
|
||||
PaletteColor::Tertiary.resolve(&printer.theme.palette)
|
||||
};
|
||||
ColorStyle::new(
|
||||
ColorType::Color(fg),
|
||||
ColorType::Palette(PaletteColor::Highlight),
|
||||
)
|
||||
ColorStyle::highlight()
|
||||
}
|
||||
} else if currently_playing {
|
||||
ColorStyle::new(
|
||||
ColorType::Color(*printer.theme.palette.custom("playing").unwrap()),
|
||||
|
||||
@@ -3,7 +3,7 @@ use std::collections::HashMap;
|
||||
|
||||
use cursive::align::HAlign;
|
||||
use cursive::event::{Event, EventResult, MouseButton, MouseEvent};
|
||||
use cursive::theme::{ColorStyle, ColorType, PaletteColor};
|
||||
use cursive::theme::ColorStyle;
|
||||
use cursive::traits::View;
|
||||
use cursive::{Cursive, Printer, Vec2};
|
||||
use unicode_width::UnicodeWidthStr;
|
||||
@@ -66,10 +66,7 @@ impl View for TabView {
|
||||
let tabwidth = printer.size.x / self.tabs.len();
|
||||
for (i, tab) in self.tabs.iter().enumerate() {
|
||||
let style = if self.selected == i {
|
||||
ColorStyle::new(
|
||||
ColorType::Palette(PaletteColor::Tertiary),
|
||||
ColorType::Palette(PaletteColor::Highlight),
|
||||
)
|
||||
ColorStyle::highlight()
|
||||
} else {
|
||||
ColorStyle::primary()
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user