aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main.rs25
1 files changed, 8 insertions, 17 deletions
diff --git a/src/main.rs b/src/main.rs
index a3cc713..ad62b77 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -5,7 +5,7 @@ extern crate cursive;
5use cursive::Cursive; 5use cursive::Cursive;
6use cursive::align::HAlign; 6use cursive::align::HAlign;
7use cursive::traits::*; 7use cursive::traits::*;
8use cursive::views::{TextView, Dialog, EditView, SelectView, LinearLayout, DummyView}; 8use cursive::views::{ TextView, Dialog, EditView, SelectView, LinearLayout, DummyView };
9 9
10pub mod content; 10pub mod content;
11use content::*; 11use content::*;
@@ -13,7 +13,6 @@ use content::*;
13fn main() { 13fn 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![];
17 16
18 main.add_global_callback('q', |s| s.quit()); 17 main.add_global_callback('q', |s| s.quit());
19 main.add_global_callback('s', |s| search(s)); 18 main.add_global_callback('s', |s| search(s));
@@ -72,19 +71,11 @@ fn on_submit(s: &mut Cursive, name: &String) {
72 Err(e) => pop_error(s, handler(e)) 71 Err(e) => pop_error(s, handler(e))
73 }; 72 };
74 73
75 let article_stack = LinearLayout::horizontal() 74 s.add_layer(
76 .child(TextView::new("Stack")) 75 Dialog::around(TextView::new(extract))
77 .child(DummyView.fixed_height(1)); 76 .title(heading)
78 77 .padding_right(5)
79 s.add_layer(Dialog::around( 78 .padding_left(5)
80 LinearLayout::horizontal() 79 .max_width(80)
81 .child( 80 );
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 );
90} 81}