diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/src/main.rs b/src/main.rs index aa10691..a3cc713 100644 --- a/src/main.rs +++ b/src/main.rs | |||
@@ -13,12 +13,15 @@ use content::*; | |||
13 | fn main() { | 13 | fn main() { |
14 | // Initial setup | 14 | // Initial setup |
15 | let mut main = Cursive::default(); | 15 | let mut main = Cursive::default(); |
16 | let mut articles_vec = vec![]; | ||
16 | 17 | ||
17 | main.add_global_callback('q', |s| s.quit()); | 18 | main.add_global_callback('q', |s| s.quit()); |
18 | main.add_global_callback('s', |s| search(s)); | 19 | main.add_global_callback('s', |s| search(s)); |
19 | main.add_global_callback('t', |s| match s.pop_layer() { | 20 | main.add_global_callback('t', |s| match s.pop_layer() { |
20 | _ => () | 21 | Some(_) => (), |
21 | }); | 22 | None => s.add_layer( Dialog::text("Stack is empty!") |
23 | .title("Error") | ||
24 | )}); | ||
22 | 25 | ||
23 | main.run(); | 26 | main.run(); |
24 | } | 27 | } |
@@ -69,11 +72,19 @@ fn on_submit(s: &mut Cursive, name: &String) { | |||
69 | Err(e) => pop_error(s, handler(e)) | 72 | Err(e) => pop_error(s, handler(e)) |
70 | }; | 73 | }; |
71 | 74 | ||
72 | s.add_layer( | 75 | let article_stack = LinearLayout::horizontal() |
73 | LinearLayout::vertical() | 76 | .child(TextView::new("Stack")) |
74 | .child(TextView::new(heading).h_align(HAlign::Center)) | 77 | .child(DummyView.fixed_height(1)); |
75 | .child(DummyView.fixed_height(1)) | 78 | |
76 | .child(TextView::new(extract) | 79 | s.add_layer(Dialog::around( |
77 | .fixed_width(85)) | 80 | LinearLayout::horizontal() |
78 | ); | 81 | .child( |
82 | LinearLayout::vertical() | ||
83 | .child(TextView::new(heading).h_align(HAlign::Center)) | ||
84 | .child(DummyView.fixed_height(1)) | ||
85 | .child(TextView::new(extract)) | ||
86 | ) | ||
87 | .child(article_stack) | ||
88 | ) | ||
89 | ); | ||
79 | } | 90 | } |