aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs36
1 files changed, 6 insertions, 30 deletions
diff --git a/src/main.rs b/src/main.rs
index af06dd5..d41e6b2 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -6,44 +6,19 @@ use cursive::Cursive;
6use cursive::traits::*; 6use cursive::traits::*;
7use cursive::views::{ TextView, Dialog, EditView, 7use cursive::views::{ TextView, Dialog, EditView,
8 SelectView, OnEventView }; 8 SelectView, OnEventView };
9use cursive::theme::PaletteColor::*;
10use cursive::theme::Color::*;
11use cursive::theme::BaseColor::*;
12use cursive::theme;
13use cursive::theme::BorderStyle;
14 9
15pub mod content; 10pub mod content;
16use content::*; 11use content::*;
17 12
13pub mod theme;
14use theme::*;
15
18fn main() { 16fn main() {
19 // Initial setup 17 // Initial setup
20 let mut main = Cursive::default(); 18 let mut main = Cursive::default();
21 19
22 // basic theme
23 let mut wikitheme = main.current_theme().clone();
24
25 // set the theme's
26 // shadow
27 wikitheme.shadow = false;
28 // border
29 wikitheme.borders = BorderStyle::Simple;
30 // and palette
31 let mut palette: theme::Palette = theme::Palette::default();
32 palette.set_color("background" , Dark(Black));
33 palette.set_color("shadow" , Dark(White));
34 palette.set_color("view" , Dark(Black));
35 palette.set_color("primary" , Dark(White));
36 palette.set_color("secondary" , Dark(Blue));
37 palette.set_color("teritary" , Dark(Green));
38 palette.set_color("title_primary" , Dark(Blue));
39 palette.set_color("title_secondary" , Dark(Green));
40 palette.set_color("highlight" , Dark(Blue));
41 palette.set_color("highlight_inactive" , Dark(Red));
42
43 wikitheme.palette = palette;
44
45 // set theme 20 // set theme
46 main.set_theme(wikitheme); 21 main.set_theme(theme_gen());
47 22
48 main.add_global_callback('q', |s| s.quit()); 23 main.add_global_callback('q', |s| s.quit());
49 main.add_global_callback('s', |s| search(s)); 24 main.add_global_callback('s', |s| search(s));
@@ -82,7 +57,8 @@ fn search(s: &mut Cursive){
82 }) 57 })
83 .button("Cancel", |s| match s.pop_layer(){ 58 .button("Cancel", |s| match s.pop_layer(){
84 _ => () 59 _ => ()
85 })); 60 })
61 .fixed_size(( 35, 5 )));
86} 62}
87 63
88fn on_submit(s: &mut Cursive, name: &String) { 64fn on_submit(s: &mut Cursive, name: &String) {