From ded6af5dc7410442c26b5272fc6afab320871f4d Mon Sep 17 00:00:00 2001 From: Alexandre Bury Date: Sat, 21 Jul 2018 12:20:04 -0700 Subject: Use PaletteColor in theme::palete_gen --- src/theme.rs | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/theme.rs b/src/theme.rs index 05a6769..5d092d3 100644 --- a/src/theme.rs +++ b/src/theme.rs @@ -1,29 +1,30 @@ -use cursive::theme::Color::*; +use cursive::theme; use cursive::theme::BaseColor::*; use cursive::theme::BorderStyle; -use cursive::theme; +use cursive::theme::Color::*; +use cursive::theme::PaletteColor::*; pub fn palette_gen() -> theme::Palette { - let mut palette: theme::Palette = theme::Palette::default(); + let mut palette = theme::Palette::default(); - palette.set_color("background" , Dark(Black)); - palette.set_color("shadow" , Light(Black)); - palette.set_color("view" , Dark(Black)); - palette.set_color("primary" , Dark(White)); - palette.set_color("secondary" , Light(Black)); - palette.set_color("teritary" , Dark(Green)); - palette.set_color("title_primary" , Dark(Blue)); - palette.set_color("title_secondary" , Dark(Green)); - palette.set_color("highlight" , Dark(Blue)); - palette.set_color("highlight_inactive" , Light(Black)); + palette[Background] = Dark(Black); + palette[Shadow] = Light(Black); + palette[View] = Dark(Black); + palette[Primary] = Dark(White); + palette[Secondary] = Light(Black); + palette[Tertiary] = Dark(Green); + palette[TitlePrimary] = Dark(Blue); + palette[TitleSecondary] = Dark(Green); + palette[Highlight] = Dark(Blue); + palette[HighlightInactive] = Light(Black); palette } pub fn theme_gen() -> theme::Theme { - let mut wikitheme = theme::load_default(); + let mut wikitheme = theme::Theme::default(); - wikitheme.shadow = false; + wikitheme.shadow = false; wikitheme.borders = BorderStyle::Simple; wikitheme.palette = palette_gen(); -- cgit v1.2.3