fix(styles): re-seed missing Standard styles on open; titled modals (#366)

Deleting/renaming Standard was already blocked in the five style
managers, but a file saved without the built-ins (foreign or damaged)
opened with broken style dropdowns and nothing to reference — re-seed
missing Standard text/dim/table/mleader/mline styles on every open.

Every modal dialog now shows its name in the title bar: centred at
15px across the dialog width, with the move grip and close button
overlaid at the right edge. The bar takes an explicit width from the
caller — a Fill child inside the Shrink frame would blow the dialog
out to the full screen.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-07-21 23:00:36 +03:00
commit ac14e0041d
7 changed files with 127 additions and 1 deletions

View file

@ -1547,6 +1547,9 @@ impl OpenCADStudio {
Some(content) => {
crate::ui::modal::modal(
composed,
self.modal_title(),
// Content width — outer size minus the frame padding.
self.modal_outer_size().map(|s| s.0 - 20.0).unwrap_or(420.0),
content,
Message::CloseModal,
self.modal_offset,
@ -1560,6 +1563,8 @@ impl OpenCADStudio {
if self.color_pick_target.is_some() {
crate::ui::modal::modal(
base,
"Select Color",
420.0,
iced::widget::container(crate::ui::color_select::color_grid_window(
Message::ColorWindowPick,
))