diff options
author | Alexandre Bury <[email protected]> | 2018-07-21 20:20:04 +0100 |
---|---|---|
committer | Alexandre Bury <[email protected]> | 2018-07-21 20:24:42 +0100 |
commit | ded6af5dc7410442c26b5272fc6afab320871f4d (patch) | |
tree | dbfec49ac20c08286af258b33eaf8cbfac977f07 | |
parent | 4c4aa1888a1c2a1d0b39cd25a9c7748466873abf (diff) |
Use PaletteColor in theme::palete_gen
-rw-r--r-- | src/theme.rs | 31 |
1 files 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 @@ | |||
1 | use cursive::theme::Color::*; | 1 | use cursive::theme; |
2 | use cursive::theme::BaseColor::*; | 2 | use cursive::theme::BaseColor::*; |
3 | use cursive::theme::BorderStyle; | 3 | use cursive::theme::BorderStyle; |
4 | use cursive::theme; | 4 | use cursive::theme::Color::*; |
5 | use cursive::theme::PaletteColor::*; | ||
5 | 6 | ||
6 | pub fn palette_gen() -> theme::Palette { | 7 | pub fn palette_gen() -> theme::Palette { |
7 | let mut palette: theme::Palette = theme::Palette::default(); | 8 | let mut palette = theme::Palette::default(); |
8 | 9 | ||
9 | palette.set_color("background" , Dark(Black)); | 10 | palette[Background] = Dark(Black); |
10 | palette.set_color("shadow" , Light(Black)); | 11 | palette[Shadow] = Light(Black); |
11 | palette.set_color("view" , Dark(Black)); | 12 | palette[View] = Dark(Black); |
12 | palette.set_color("primary" , Dark(White)); | 13 | palette[Primary] = Dark(White); |
13 | palette.set_color("secondary" , Light(Black)); | 14 | palette[Secondary] = Light(Black); |
14 | palette.set_color("teritary" , Dark(Green)); | 15 | palette[Tertiary] = Dark(Green); |
15 | palette.set_color("title_primary" , Dark(Blue)); | 16 | palette[TitlePrimary] = Dark(Blue); |
16 | palette.set_color("title_secondary" , Dark(Green)); | 17 | palette[TitleSecondary] = Dark(Green); |
17 | palette.set_color("highlight" , Dark(Blue)); | 18 | palette[Highlight] = Dark(Blue); |
18 | palette.set_color("highlight_inactive" , Light(Black)); | 19 | palette[HighlightInactive] = Light(Black); |
19 | 20 | ||
20 | palette | 21 | palette |
21 | } | 22 | } |
22 | 23 | ||
23 | pub fn theme_gen() -> theme::Theme { | 24 | pub fn theme_gen() -> theme::Theme { |
24 | let mut wikitheme = theme::load_default(); | 25 | let mut wikitheme = theme::Theme::default(); |
25 | 26 | ||
26 | wikitheme.shadow = false; | 27 | wikitheme.shadow = false; |
27 | wikitheme.borders = BorderStyle::Simple; | 28 | wikitheme.borders = BorderStyle::Simple; |
28 | wikitheme.palette = palette_gen(); | 29 | wikitheme.palette = palette_gen(); |
29 | 30 | ||