forked from 1b-agent/opencadstudio-upstream
feat(ui): shared in-canvas modal overlay; migrate About (Plan B)
Start Plan B — replace the daemon's pop-up OS windows with in-canvas modal overlays so dialogs work identically on native (one main window) and web (canvas only). - New `ui::modal::modal(base, content, on_close)`: dims the view behind a backdrop that blocks clicks but does NOT dismiss, frames the content, and adds a top-right ✕ as the sole close affordance. Sizes to the content (no `Fill`), so dialogs shrink to fit. - view_main stacks the active modal on top, so both run paths show it. - Migrate About as the pilot: `about_open` bool + AboutOpen/AboutClose instead of an OS window; About's view shrinks to content. Remaining dialogs migrate to the same pattern next. Native + 75 tests OK. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
9d378a0533
commit
e6213eafbb
6 files changed
+127
-21
No files matched your search
+15
-3
@@ -1499,7 +1499,7 @@ impl OpenCADStudio {
|
||||
iced::widget::Space::new().width(0).height(0).into()
|
||||
};
|
||||
|
||||
stack![
|
||||
let composed = stack![
|
||||
main_ui,
|
||||
self.app_menu.view(),
|
||||
snap_layer,
|
||||
@@ -1512,8 +1512,20 @@ impl OpenCADStudio {
|
||||
layout_ctx_layer,
|
||||
qselect_layer,
|
||||
open_progress_layer,
|
||||
]
|
||||
.into()
|
||||
];
|
||||
|
||||
// ── In-canvas modal dialogs (Plan B) ───────────────────────────────
|
||||
// Former pop-up windows render as overlays here, so they work on both
|
||||
// the native (single main window) and web builds.
|
||||
if self.about_open {
|
||||
crate::ui::modal::modal(
|
||||
composed,
|
||||
crate::ui::about::view_window(),
|
||||
Message::AboutClose,
|
||||
)
|
||||
} else {
|
||||
composed.into()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn subscription(&self) -> Subscription<Message> {
|
||||
|
||||
Reference in new issue
Block a user