a bit more ui wrangling

main
aprzn 2 years ago
parent 45e741359f
commit f6e1e423e9

@ -194,25 +194,23 @@ impl PipeDash {
egui::SidePanel::left("level_picker") egui::SidePanel::left("level_picker")
.default_width(100f32) .default_width(100f32)
.show(ctx, |ui| { .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), |ui| {
ui.with_layout(egui::Layout::top_down(egui::Align::LEFT).with_main_justify(true), |ui| { ui.button("Load Level");
egui::ScrollArea::vertical().show(ui, |ui| { egui::ScrollArea::vertical().show(ui, |ui| {
ui.with_layout(egui::Layout::top_down_justified(egui::Align::Min), |ui| { ui.with_layout(egui::Layout::top_down_justified(egui::Align::Min), |ui| {
for (idx, level) in self.level_list.iter().enumerate() { for (idx, level) in self.level_list.iter().enumerate() {
if ui if ui
.selectable_label( .selectable_label(
self.selected_level == Some(idx), self.selected_level == Some(idx),
level.display_name(), level.display_name(),
) )
.clicked() .clicked()
{ {
self.msg_queue.push_back(Message::LevelSelected(idx)); self.msg_queue.push_back(Message::LevelSelected(idx));
}
} }
}) }
}); })
}); });
ui.button("Load Level");
}); });
}); });
} }

Loading…
Cancel
Save