make level list scrollable

main
aprzn 2 years ago
parent c452ca6f17
commit 240abccc58

@ -46,6 +46,7 @@ impl eframe::App for PipeDash {
ctx.set_pixels_per_point(2f32); ctx.set_pixels_per_point(2f32);
egui::SidePanel::left("level_picker").default_width(100f32).show(ctx, |ui| { egui::SidePanel::left("level_picker").default_width(100f32).show(ctx, |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.selectable_label(self.selected_level == Some(idx), level.display_name()).clicked() { if ui.selectable_label(self.selected_level == Some(idx), level.display_name()).clicked() {
@ -54,6 +55,8 @@ impl eframe::App for PipeDash {
} }
}) })
}); });
});
egui::CentralPanel::default().show(ctx, |ui| { egui::CentralPanel::default().show(ctx, |ui| {
ui.vertical_centered_justified(|ui| { ui.vertical_centered_justified(|ui| {
ui.horizontal_top(|ui| { ui.horizontal_top(|ui| {

Loading…
Cancel
Save