Skip to content

Commit

Permalink
feat: linear layout for search replace list
Browse files Browse the repository at this point in the history
  • Loading branch information
Terkwood committed Jun 8, 2022
1 parent 5ffd0f1 commit 174afb0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,14 @@ fn refresh_fake_list(siv: &mut Cursive) {
let _ = siv.with_user_data(|blurbs: &mut Vec<ReplacementCandidate>| {
fake_stuff.clear();
for b in blurbs {
fake_stuff.add_child(&b.search, TextArea::new().content(b.preview_blurb.clone()))
let linear = LinearLayout::horizontal()
.child(TextArea::new().content(b.preview_blurb.clone()))
.child(DummyView)
.child(Button::new("OK", bogus))
.child(DummyView)
.child(Button::new("Skip", bogus));

fake_stuff.add_child(&b.search, linear)
}
});
}
Expand All @@ -112,6 +119,8 @@ fn update_fake_db(siv: &mut Cursive, input: ReplacementCandidate) {
refresh_fake_list(siv);
}

fn bogus(_siv: &mut Cursive) {}

fn on_name_click(s: &mut Cursive, name: &str) {
s.add_layer(
Dialog::text(format!("Name: {}\nAwesome: maybe", name))
Expand Down

0 comments on commit 174afb0

Please sign in to comment.