From e1168eeb115160141ff7cbc2deca3cfed66a3852 Mon Sep 17 00:00:00 2001 From: NerdyPepper Date: Sat, 14 Jul 2018 21:16:57 +0530 Subject: Simplify interface --- src/main.rs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index bd009e7..e604b40 100644 --- a/src/main.rs +++ b/src/main.rs @@ -87,21 +87,23 @@ fn on_submit(s: &mut Cursive, name: &String) { }; // get the act together - let mut article_content = TextView::new(heading); - article_content.append(String::from("\n\n")); - article_content.append(extract_formatter(extract)); + let article_content = TextView::new(extract_formatter(extract)); let links = SelectView::::new() .with_all_str(link_vec) - .on_submit(on_submit); + .on_submit(on_submit) + .fixed_width(20); s.add_layer( - OnEventView::new( - LinearLayout::horizontal() - .child(article_content.fixed_width(72)) - .child(DummyView) - .child(links) + Dialog::around( + OnEventView::new( + LinearLayout::horizontal() + .child(article_content.fixed_width(72)) + .child(DummyView) + .child(links) + ) + .on_event('t', |s| match s.pop_layer() { _ => () }) ) - .on_event('t', |s| match s.pop_layer() { _ => () }) + .title(heading) ); } -- cgit v1.2.3