aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshay <[email protected]>2018-07-22 02:57:36 +0100
committerGitHub <[email protected]>2018-07-22 02:57:36 +0100
commit650f6fb3656d4c302dadedd4c1876f7d3b5e21db (patch)
treeb5a0542b6147b7b5764d98e196d29fbbbc44279f
parent8a8c7bb793e7a60ad1936080394d64ac7bb1b0ab (diff)
parentded6af5dc7410442c26b5272fc6afab320871f4d (diff)
Merge pull request #2 from gyscos/theme
Use PaletteColor in theme::palete_gen
-rw-r--r--src/theme.rs31
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 @@
1use cursive::theme::Color::*; 1use cursive::theme;
2use cursive::theme::BaseColor::*; 2use cursive::theme::BaseColor::*;
3use cursive::theme::BorderStyle; 3use cursive::theme::BorderStyle;
4use cursive::theme; 4use cursive::theme::Color::*;
5use cursive::theme::PaletteColor::*;
5 6
6pub fn palette_gen() -> theme::Palette { 7pub 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
23pub fn theme_gen() -> theme::Theme { 24pub 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