From ac49a8828da3faf0ad5267bbb977d01b486e2ec3 Mon Sep 17 00:00:00 2001 From: Mike Dilger Date: Fri, 30 Dec 2022 11:33:34 +1300 Subject: [PATCH] close-all and open-all buttons --- src/ui/feed.rs | 61 ++++++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/src/ui/feed.rs b/src/ui/feed.rs index a2d09482..22a593a7 100644 --- a/src/ui/feed.rs +++ b/src/ui/feed.rs @@ -21,36 +21,39 @@ pub(super) fn update(app: &mut GossipUi, ctx: &Context, frame: &mut eframe::Fram let incoming_count = GLOBALS.incoming_events.blocking_read().len(); ui.with_layout(Layout::right_to_left(Align::TOP), |ui| { - ui.with_layout(Layout::top_down(Align::Max), |ui| { - if ui - .button(&format!( - "Query relays for {} missing events", - desired_count - )) - .clicked() - { - let tx = GLOBALS.to_overlord.clone(); - let _ = tx.send(BusMessage { - target: "overlord".to_string(), - kind: "get_missing_events".to_string(), - json_payload: serde_json::to_string("").unwrap(), - }); - } - }); + if ui + .button(&format!( + "Query relays for {} missing events", + desired_count + )) + .clicked() + { + let tx = GLOBALS.to_overlord.clone(); + let _ = tx.send(BusMessage { + target: "overlord".to_string(), + kind: "get_missing_events".to_string(), + json_payload: serde_json::to_string("").unwrap(), + }); + } - ui.with_layout(Layout::top_down(Align::Max), |ui| { - if ui - .button(&format!("Process {} incoming events", incoming_count)) - .clicked() - { - let tx = GLOBALS.to_overlord.clone(); - let _ = tx.send(BusMessage { - target: "overlord".to_string(), - kind: "process_incoming_events".to_string(), - json_payload: serde_json::to_string("").unwrap(), - }); - } - }); + if ui + .button(&format!("Process {} incoming events", incoming_count)) + .clicked() + { + let tx = GLOBALS.to_overlord.clone(); + let _ = tx.send(BusMessage { + target: "overlord".to_string(), + kind: "process_incoming_events".to_string(), + json_payload: serde_json::to_string("").unwrap(), + }); + } + + if ui.button("▶ close all" ).clicked() { + app.hides = feed.clone(); + } + if ui.button("▼ open all").clicked() { + app.hides.clear(); + } }); ui.vertical(|ui| {