forked from 1b-agent/opencadstudio-upstream
PDF import keeps drawing order when joining strokes; automation: layer toggle and page selection
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
f63e351a12
commit
28853cd32e
2 files changed
+23
-3
No files matched your search
@@ -48,6 +48,8 @@ fn color_value(color: acadrust::types::Color) -> Value {
|
||||
pub(super) const NAMES: &[&str] = &[
|
||||
"close_modal",
|
||||
"pdf_dialog_ok",
|
||||
"pdf_layer_toggle",
|
||||
"pdf_page_select",
|
||||
"close_document",
|
||||
"toggle_properties",
|
||||
"toggle_layers",
|
||||
@@ -665,6 +667,22 @@ impl OpenCADStudio {
|
||||
let msg = match name {
|
||||
"close_modal" => Message::CloseModal,
|
||||
// The open PDF dialog's OK button.
|
||||
// Underlay Layers: switch a layer of the shown underlay.
|
||||
"pdf_layer_toggle" => Message::PdfDialog(
|
||||
crate::ui::window::pdf_dialogs::PdfDialogMsg::LayersToggle(string(req, "value")?.into()),
|
||||
),
|
||||
// Attach dialog: choose pages by index ("0,2").
|
||||
"pdf_page_select" => {
|
||||
let pages: Vec<usize> = string(req, "value")?
|
||||
.split(',')
|
||||
.filter_map(|p| p.trim().parse().ok())
|
||||
.collect();
|
||||
let Some(state) = self.pdf_attach.as_mut() else {
|
||||
return Err(failure("no_dialog", "The Attach dialog is not open"));
|
||||
};
|
||||
state.selected = pages;
|
||||
return Ok(Task::none());
|
||||
}
|
||||
"pdf_dialog_ok" => {
|
||||
use crate::ui::window::pdf_dialogs::PdfDialogMsg;
|
||||
Message::PdfDialog(match self.active_modal {
|
||||
|
||||
Reference in new issue
Block a user