mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-19 19:46:50 +00:00
layout relay page differently so the scrollable area is less likely to have no room
This commit is contained in:
parent
07d85b9457
commit
a4d331533e
@ -50,17 +50,30 @@ pub(super) fn update(app: &mut GossipUi, _ctx: &Context, _frame: &mut eframe::Fr
|
|||||||
.map(|r| r.to_owned())
|
.map(|r| r.to_owned())
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
ui.add_space(32.0);
|
ui.horizontal(|ui| {
|
||||||
|
ui.set_max_height(0.0); // tries to be as short as possible
|
||||||
|
|
||||||
ui.heading("Connected to:");
|
ui.with_layout(Layout::top_down(Align::Min), |ui| {
|
||||||
|
ui.heading("Connected to:");
|
||||||
|
for url in GLOBALS.relays_watching.blocking_read().iter() {
|
||||||
|
ui.label(url.inner());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
for url in GLOBALS.relays_watching.blocking_read().iter() {
|
ui.add_space(12.0);
|
||||||
ui.label(url.inner());
|
ui.separator();
|
||||||
}
|
ui.add_space(12.0);
|
||||||
|
|
||||||
ui.add_space(10.0);
|
ui.with_layout(Layout::top_down(Align::Min), |ui| {
|
||||||
ui.separator();
|
ui.heading("Writing to:");
|
||||||
ui.add_space(10.0);
|
for relay in postrelays.iter() {
|
||||||
|
render_relay(ui, relay, true);
|
||||||
|
ui.add_space(3.0);
|
||||||
|
ui.separator();
|
||||||
|
ui.add_space(3.0);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
ui.with_layout(Layout::bottom_up(Align::Center), |ui| {
|
ui.with_layout(Layout::bottom_up(Align::Center), |ui| {
|
||||||
if ui.button("SAVE CHANGES").clicked() {
|
if ui.button("SAVE CHANGES").clicked() {
|
||||||
@ -68,15 +81,6 @@ pub(super) fn update(app: &mut GossipUi, _ctx: &Context, _frame: &mut eframe::Fr
|
|||||||
}
|
}
|
||||||
|
|
||||||
ui.with_layout(Layout::top_down(Align::Center), |ui| {
|
ui.with_layout(Layout::top_down(Align::Center), |ui| {
|
||||||
ui.heading("Your Relays (write):");
|
|
||||||
|
|
||||||
for relay in postrelays.iter() {
|
|
||||||
render_relay(ui, relay, true);
|
|
||||||
ui.add_space(3.0);
|
|
||||||
ui.separator();
|
|
||||||
ui.add_space(3.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
ui.heading("Other Known Relays:");
|
ui.heading("Other Known Relays:");
|
||||||
|
|
||||||
ScrollArea::vertical().show(ui, |ui| {
|
ScrollArea::vertical().show(ui, |ui| {
|
||||||
@ -91,6 +95,10 @@ pub(super) fn update(app: &mut GossipUi, _ctx: &Context, _frame: &mut eframe::Fr
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ui.add_space(10.0);
|
||||||
|
ui.separator();
|
||||||
|
ui.add_space(10.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn render_relay(ui: &mut Ui, relay: &DbRelay, bold: bool) {
|
fn render_relay(ui: &mut Ui, relay: &DbRelay, bold: bool) {
|
||||||
|
Loading…
Reference in New Issue
Block a user