forked from 1b-agent/opencadstudio-upstream
Insert Reference panel: separate Attach XREF and Attach PDF buttons
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 <noreply@anthropic.com>
This commit is contained in:
1 parent
857f2f2e58
commit
b060d46894
4 files changed
+18
-4
No files matched your search
@@ -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()),
|
||||
|
||||
@@ -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] = [
|
||||
|
||||
@@ -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()),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user