Correct modal layout

This commit is contained in:
David Holland 2023-02-10 09:48:29 +01:00
parent 3c340ef714
commit c5e597bbea
Signed by: DustVoice
GPG Key ID: 47068995A14EDCA9
1 changed files with 2 additions and 5 deletions

View File

@ -105,7 +105,7 @@ impl eframe::App for Ui {
ctx.request_repaint(); ctx.request_repaint();
} }
self.allowed_to_close = true; // self.allowed_to_close = true;
egui::TopBottomPanel::bottom("status_bar").show(ctx, |ui| { egui::TopBottomPanel::bottom("status_bar").show(ctx, |ui| {
ui.columns(2, |_columns| {}); ui.columns(2, |_columns| {});
}); });
@ -166,10 +166,8 @@ impl eframe::App for Ui {
if self.show_confirmation_dialog { if self.show_confirmation_dialog {
// Show confirmation dialog: // Show confirmation dialog:
ui.separator(); ui.with_layout(Layout::top_down_justified(Align::Center).with_main_align(Align::Center).with_cross_align(Align::Center), |ui| {
ui.vertical(|ui| {
ui.label("Really quit?"); ui.label("Really quit?");
ui.horizontal(|ui| {
if ui.button("Yes").clicked() { if ui.button("Yes").clicked() {
self.allowed_to_close = true; self.allowed_to_close = true;
frame.close(); frame.close();
@ -179,7 +177,6 @@ impl eframe::App for Ui {
self.modal = false; self.modal = false;
self.show_confirmation_dialog = false; self.show_confirmation_dialog = false;
} }
});
}); });
} }
}); });