feat(plotstyle): improve CTB editor workflow

This commit is contained in:
gianlucafiore committed 2026-08-10 19:09:40 -03:00
1 parent 22a294c705
commit e2e4bfdcd4
9 files changed
+271 -48

No files matched your search

+26 -2
View File
@@ -1829,6 +1829,30 @@ impl OpenCADStudio {
open_progress_layer,
];
// If the Plot Style editor was launched from PLOT, keep the Plot dialog
// rendered underneath as its blocked parent.
let modal_underlay: Element<'_, Message> =
if self.active_modal == Some(super::ModalKind::Plotstyle) {
if let Some((plot_offset, plot_resize)) =
self.plotstyle_parent_plot_geometry.as_ref()
{
let plot_content = self.plot_modal_content(*plot_resize);
crate::ui::modal::modal(
composed,
crate::tr!("modal", "plot"),
plot_content,
Message::CloseModal,
*plot_offset,
crate::ui::modal::ModalOptions::STANDARD,
)
} else {
composed.into()
}
} else {
composed.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.
@@ -1842,7 +1866,7 @@ impl OpenCADStudio {
crate::ui::modal::ModalOptions::STANDARD
};
crate::ui::modal::modal(
composed,
modal_underlay,
self.modal_title(),
content,
Message::CloseModal,
@@ -1850,7 +1874,7 @@ impl OpenCADStudio {
modal_options,
)
}
None => composed.into(),
None => modal_underlay,
};
// Shared CAD colour picker. Indexed ACI colours use OpenCADStudio's own
// dialog; True Color keeps the existing iced_aw gradient picker.
+18 -15
View File
@@ -50,7 +50,23 @@ impl OpenCADStudio {
None => String::new(),
}
}
pub(super) fn plot_modal_content<'s>(
&'s self,
extra: iced::Vector,
) -> Element<'s, Message> {
sized_flow(
extra,
760,
540,
|flow| {
crate::ui::window::plot::view_window(
&self.plot_dialog,
self.print_all_options,
flow,
)
},
)
}
/// Build the currently-open modal dialog's content (Plan B), or `None`.
/// Iced 0.15 measures the content first, so dialogs start at their natural
/// size and overflowing regions become scrollable where a cap is supplied.
@@ -280,20 +296,7 @@ impl OpenCADStudio {
})
}
}
super::super::ModalKind::Plot => {
sized_flow(
ex,
760,
540,
|flow| {
crate::ui::window::plot::view_window(
&self.plot_dialog,
self.print_all_options,
flow,
)
},
)
}
super::super::ModalKind::Plot => self.plot_modal_content(ex),
super::super::ModalKind::PrintAll => sized_flow(
ex,
520,