From f6e1e423e93aa33c82f1f4dfa851f419eee640f0 Mon Sep 17 00:00:00 2001 From: aprzn Date: Fri, 10 Feb 2023 01:03:46 -0500 Subject: [PATCH] a bit more ui wrangling --- src/main.rs | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/src/main.rs b/src/main.rs index 6c3699d..cb793e0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -194,25 +194,23 @@ impl PipeDash { egui::SidePanel::left("level_picker") .default_width(100f32) .show(ctx, |ui| { - ui.with_layout(egui::Layout::top_down(egui::Align::LEFT).with_main_justify(false), |ui| { - ui.with_layout(egui::Layout::top_down(egui::Align::LEFT).with_main_justify(true), |ui| { - egui::ScrollArea::vertical().show(ui, |ui| { - ui.with_layout(egui::Layout::top_down_justified(egui::Align::Min), |ui| { - for (idx, level) in self.level_list.iter().enumerate() { - if ui - .selectable_label( - self.selected_level == Some(idx), - level.display_name(), - ) - .clicked() - { - self.msg_queue.push_back(Message::LevelSelected(idx)); - } + ui.with_layout(egui::Layout::top_down(egui::Align::LEFT), |ui| { + ui.button("Load Level"); + egui::ScrollArea::vertical().show(ui, |ui| { + ui.with_layout(egui::Layout::top_down_justified(egui::Align::Min), |ui| { + for (idx, level) in self.level_list.iter().enumerate() { + if ui + .selectable_label( + self.selected_level == Some(idx), + level.display_name(), + ) + .clicked() + { + self.msg_queue.push_back(Message::LevelSelected(idx)); } - }) - }); + } + }) }); - ui.button("Load Level"); }); }); }