From b060d468947932df412f522c7c140bea7a88b316 Mon Sep 17 00:00:00 2001 From: ramox81 <184937705+ramox81@users.noreply.github.com> Date: Fri, 25 Sep 2026 15:08:20 +0300 Subject: [PATCH] Insert Reference panel: separate Attach XREF and Attach PDF buttons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The single Attach button gives way to Attach XREF (XATTACH, the external reference picker and dialog) and Attach PDF (PDFATTACH, the PDF picker and Attach PDF Underlay dialog) with their own icons. ATTACH stays available as a command. The Turkish label reads "PDF Bağla". Co-Authored-By: Claude Opus 5.5 --- locales/tr-TR/opencadstudio.ftl | 2 +- src/modules/insert/mod.rs | 1 + src/modules/insert/pdf_attach.rs | 13 +++++++++++++ src/modules/insert/xattach.rs | 6 +++--- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/locales/tr-TR/opencadstudio.ftl b/locales/tr-TR/opencadstudio.ftl index 86a7aee2f..36314bfc1 100644 --- a/locales/tr-TR/opencadstudio.ftl +++ b/locales/tr-TR/opencadstudio.ftl @@ -1528,7 +1528,7 @@ common = .decimal-degrees = Ondalık derece .deg-min-sec-55d08d = Derece/dakika/saniye .block-palette-9925cd = { common.block-palette } - .attach-pdf = { insert.attach } PDF + .attach-pdf = PDF Bağla .no-leader = { common.leader } · { common.none-title-case } .no-leader-5e6b2a = /{ common.no-leader } .leader-c5dd1e = /{ common.leader } diff --git a/src/modules/insert/mod.rs b/src/modules/insert/mod.rs index 610f48934..e157971ca 100644 --- a/src/modules/insert/mod.rs +++ b/src/modules/insert/mod.rs @@ -52,6 +52,7 @@ impl CadModule for InsertModule { title: "Reference", tools: vec![ RibbonItem::LargeTool(xattach::tool()), + RibbonItem::LargeTool(pdf_attach::tool()), RibbonItem::LargeTool(xclip::tool()), RibbonItem::LargeTool(xadjust::tool()), RibbonItem::LabeledTool(underlay_layers::tool()), diff --git a/src/modules/insert/pdf_attach.rs b/src/modules/insert/pdf_attach.rs index a52c2ec19..78e5d5fc4 100644 --- a/src/modules/insert/pdf_attach.rs +++ b/src/modules/insert/pdf_attach.rs @@ -21,6 +21,19 @@ use glam::DVec3; use crate::command::{CadCommand, CmdOption, CmdResult, InputKind, WorkingPlane}; use crate::scene::model::wire_model::WireModel; +use crate::modules::{IconKind, ModuleEvent, ToolDef}; + +pub const ICON: IconKind = + IconKind::Svg(include_bytes!("../../../assets/icons/underlay_layers.svg")); + +pub fn tool() -> ToolDef { + ToolDef { + id: "PDFATTACH", + label: "Attach PDF", + icon: ICON, + event: ModuleEvent::Command("PDFATTACH".to_string()), + } +} /// Units the Unit option offers: keyword, the name the prompt shows. const UNITS: [(&str, &str); 9] = [ diff --git a/src/modules/insert/xattach.rs b/src/modules/insert/xattach.rs index f4d25c15d..141342417 100644 --- a/src/modules/insert/xattach.rs +++ b/src/modules/insert/xattach.rs @@ -26,10 +26,10 @@ use crate::scene::Scene; pub fn tool() -> ToolDef { ToolDef { - id: "ATTACH", - label: "Attach", + id: "XATTACH", + label: "Attach XREF", icon: IconKind::Svg(include_bytes!("../../../assets/icons/blocks/insert.svg")), - event: ModuleEvent::Command("ATTACH".to_string()), + event: ModuleEvent::Command("XATTACH".to_string()), } }