diff options
author | NerdyPepper <[email protected]> | 2018-06-25 17:17:06 +0100 |
---|---|---|
committer | NerdyPepper <[email protected]> | 2018-06-25 17:17:06 +0100 |
commit | 7157ce3790af718359dc2aaa089cc6fc843284b7 (patch) | |
tree | fd2f7b70fda1b15e56c9c19ae071d9f751135f8d | |
parent | e531563fd343c3fa771fac723a13020462b56b19 (diff) |
Begin work on article stack view
-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 | } |