forked from 1b-agent/opencadstudio-upstream
feat(ui): MTEXT editor in shared modal + resizable dialogs
Route the MTEXT editor through the shared in-canvas modal frame with an Apply-at-top toolbar (style-manager style): Apply commits and keeps the editor open (creates on first apply, updates in place after), the ✕ cancels. Give every modal a bottom-right corner resize grip driven by a shared grow-only `modal_resize` delta that resets with `modal_offset` on open/close, so each dialog opens at its natural size and can be dragged larger — style managers included. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
f797fd800b
commit
977701b47e
10 files changed
+221
-70
No files matched your search
@@ -702,6 +702,7 @@ pub(super) fn on_tab_close(&mut self, idx: usize) -> Task<Message> {
|
||||
self.layer_delete_pending = Some((names, count));
|
||||
self.active_modal = Some(crate::app::ModalKind::LayerDeleteWarning);
|
||||
self.modal_offset = iced::Vector::ZERO;
|
||||
self.modal_resize = iced::Vector::ZERO;
|
||||
}
|
||||
Task::none()
|
||||
}
|
||||
@@ -712,6 +713,7 @@ pub(super) fn on_tab_close(&mut self, idx: usize) -> Task<Message> {
|
||||
let i = self.active_tab;
|
||||
self.active_modal = None;
|
||||
self.modal_offset = iced::Vector::ZERO;
|
||||
self.modal_resize = iced::Vector::ZERO;
|
||||
let Some((names, _)) = self.layer_delete_pending.take() else {
|
||||
return Task::none();
|
||||
};
|
||||
@@ -1668,6 +1670,7 @@ pub(super) fn on_tab_close(&mut self, idx: usize) -> Task<Message> {
|
||||
self.attr_editor_handle = Some(handle);
|
||||
self.active_modal = Some(crate::app::ModalKind::AttributeEditor);
|
||||
self.modal_offset = iced::Vector::ZERO;
|
||||
self.modal_resize = iced::Vector::ZERO;
|
||||
}
|
||||
Err(msg) => self.command_line.push_error(msg),
|
||||
}
|
||||
@@ -1687,6 +1690,7 @@ pub(super) fn on_tab_close(&mut self, idx: usize) -> Task<Message> {
|
||||
if self.active_modal == Some(crate::app::ModalKind::AttributeEditor) {
|
||||
self.active_modal = None;
|
||||
self.modal_offset = iced::Vector::ZERO;
|
||||
self.modal_resize = iced::Vector::ZERO;
|
||||
}
|
||||
self.attr_editor_handle = None;
|
||||
self.attr_editor_block.clear();
|
||||
|
||||
Reference in new issue
Block a user