close-all and open-all buttons

This commit is contained in:
Mike Dilger 2022-12-30 11:33:34 +13:00
parent aeab1e98b1
commit ac49a8828d

View File

@ -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(); let incoming_count = GLOBALS.incoming_events.blocking_read().len();
ui.with_layout(Layout::right_to_left(Align::TOP), |ui| { ui.with_layout(Layout::right_to_left(Align::TOP), |ui| {
ui.with_layout(Layout::top_down(Align::Max), |ui| { if ui
if ui .button(&format!(
.button(&format!( "Query relays for {} missing events",
"Query relays for {} missing events", desired_count
desired_count ))
)) .clicked()
.clicked() {
{ let tx = GLOBALS.to_overlord.clone();
let tx = GLOBALS.to_overlord.clone(); let _ = tx.send(BusMessage {
let _ = tx.send(BusMessage { target: "overlord".to_string(),
target: "overlord".to_string(), kind: "get_missing_events".to_string(),
kind: "get_missing_events".to_string(), json_payload: serde_json::to_string("").unwrap(),
json_payload: serde_json::to_string("").unwrap(), });
}); }
}
});
ui.with_layout(Layout::top_down(Align::Max), |ui| { if ui
if ui .button(&format!("Process {} incoming events", incoming_count))
.button(&format!("Process {} incoming events", incoming_count)) .clicked()
.clicked() {
{ let tx = GLOBALS.to_overlord.clone();
let tx = GLOBALS.to_overlord.clone(); let _ = tx.send(BusMessage {
let _ = tx.send(BusMessage { target: "overlord".to_string(),
target: "overlord".to_string(), kind: "process_incoming_events".to_string(),
kind: "process_incoming_events".to_string(), json_payload: serde_json::to_string("").unwrap(),
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| { ui.vertical(|ui| {