make level list scrollable

main
aprzn 2 years ago
parent c452ca6f17
commit 240abccc58

@ -46,14 +46,17 @@ impl eframe::App for PipeDash {
ctx.set_pixels_per_point(2f32);
egui::SidePanel::left("level_picker").default_width(100f32).show(ctx, |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(LevelSelected(idx));
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(LevelSelected(idx));
}
}
}
})
})
});
});
egui::CentralPanel::default().show(ctx, |ui| {
ui.vertical_centered_justified(|ui| {
ui.horizontal_top(|ui| {

Loading…
Cancel
Save