forked from 1b-agent/opencadstudio-upstream
feat(ui): migrate Text Style and Multiline Style to modals (Plan B)
Move the Text Style and Multiline Style editors off OS windows onto the shared `active_modal` / `modal_content` path. Their open handlers set `active_modal` (keeping the existing buffer/stage setup); construction moves from the daemon `view` dispatch into `modal_content`. The remaining style editors (Table, MLeader, Dimension) still use OS windows for now — they carry a nested colour picker that needs its own handling. Native + web build; 75 tests pass. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
b21d10f6e8
commit
7cd938443e
3 files changed
+83
-101
No files matched your search
+8
-32
@@ -6349,25 +6349,13 @@ impl OpenCADStudio {
|
||||
.unwrap_or_else(|| "Standard".to_string())
|
||||
};
|
||||
self.load_textstyle_bufs(i);
|
||||
if let Some(id) = self.textstyle_window {
|
||||
return window::gain_focus(id);
|
||||
}
|
||||
let (id, task) = window::open(window::Settings {
|
||||
size: iced::Size::new(620.0, 460.0),
|
||||
resizable: true,
|
||||
level: window::Level::AlwaysOnTop,
|
||||
..Default::default()
|
||||
});
|
||||
self.textstyle_window = Some(id);
|
||||
self.active_modal = Some(super::ModalKind::TextStyle);
|
||||
self.style_stage_begin();
|
||||
task.map(|_| Message::Noop)
|
||||
Task::none()
|
||||
}
|
||||
Message::TextStyleDialogClose => {
|
||||
if let Some(id) = self.textstyle_window.take() {
|
||||
window::close(id)
|
||||
} else {
|
||||
Task::none()
|
||||
}
|
||||
self.active_modal = None;
|
||||
Task::none()
|
||||
}
|
||||
Message::TextStyleDialogSelect(name) => {
|
||||
let i = self.active_tab;
|
||||
@@ -6830,25 +6818,13 @@ impl OpenCADStudio {
|
||||
})
|
||||
.unwrap_or_else(|| "Standard".to_string())
|
||||
};
|
||||
if let Some(id) = self.mlstyle_window {
|
||||
return window::gain_focus(id);
|
||||
}
|
||||
let (id, task) = window::open(window::Settings {
|
||||
size: iced::Size::new(620.0, 420.0),
|
||||
resizable: true,
|
||||
level: window::Level::AlwaysOnTop,
|
||||
..Default::default()
|
||||
});
|
||||
self.mlstyle_window = Some(id);
|
||||
self.active_modal = Some(super::ModalKind::MlStyle);
|
||||
self.style_stage_begin();
|
||||
task.map(|_| Message::Noop)
|
||||
Task::none()
|
||||
}
|
||||
Message::MlStyleDialogClose => {
|
||||
if let Some(id) = self.mlstyle_window.take() {
|
||||
window::close(id)
|
||||
} else {
|
||||
Task::none()
|
||||
}
|
||||
self.active_modal = None;
|
||||
Task::none()
|
||||
}
|
||||
Message::MlStyleDialogSelect(name) => {
|
||||
self.mlstyle_selected = name;
|
||||
|
||||
Reference in new issue
Block a user