Fit modal dialogs to the phone screen on mobile

Add mobile::dialog_width(ctx, desired) — a min()-clamp that's a no-op on wide
desktop screens. Clamp the Export and Export Progress modals and the Sample
Import window to it. Render Preferences as an egui::Modal (dim backdrop, centered,
no title bar) with a screen-fit scroll height when mobile_active(); desktop keeps
its window. Extracted the preferences body into render_body() shared by both paths.
This commit is contained in:
Skyler Lehmkuhl
2026-07-01 06:28:04 -04:00
parent a0ac4f2d35
commit f13a127c9d
5 changed files with 102 additions and 64 deletions
@@ -208,7 +208,7 @@ impl ExportDialog {
let modal_response = egui::Modal::new(egui::Id::new("export_dialog_modal"))
.show(ctx, |ui| {
ui.set_width(500.0);
ui.set_width(crate::mobile::dialog_width(ctx, 500.0));
ui.heading(window_title);
ui.add_space(8.0);
@@ -801,7 +801,7 @@ impl ExportProgressDialog {
egui::Modal::new(egui::Id::new("export_progress_modal"))
.show(ctx, |ui| {
ui.set_width(400.0);
ui.set_width(crate::mobile::dialog_width(ctx, 400.0));
ui.heading("Exporting...");
ui.add_space(8.0);