forked from 1b-agent/opencadstudio-upstream
Insert Reference panel: one Attach, labelled underlay tools, slide-out with Edit Reference and xref fading
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
1a6279e841
commit
95e2bae0d2
35 files changed
+352
-54
No files matched your search
+23
-25
@@ -47,41 +47,39 @@ 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::Tool(underlay_layers::tool()),
|
||||
RibbonItem::Dropdown {
|
||||
RibbonItem::LabeledTool(underlay_layers::tool()),
|
||||
// An empty label shows the chosen item's.
|
||||
RibbonItem::LabeledDropdown {
|
||||
id: "FRAMES_DROPDOWN",
|
||||
label: "",
|
||||
icon: IconKind::Svg(include_bytes!(
|
||||
"../../../assets/icons/underlay_frames.svg"
|
||||
)),
|
||||
items: vec![
|
||||
(
|
||||
"FRAMES0",
|
||||
"Frames Off",
|
||||
IconKind::Svg(include_bytes!(
|
||||
"../../../assets/icons/underlay_frames.svg"
|
||||
)),
|
||||
),
|
||||
(
|
||||
"FRAMES1",
|
||||
"Frames On",
|
||||
IconKind::Svg(include_bytes!(
|
||||
"../../../assets/icons/underlay_frames.svg"
|
||||
)),
|
||||
),
|
||||
(
|
||||
"FRAMES2",
|
||||
"Frames On, Not Plotted",
|
||||
IconKind::Svg(include_bytes!(
|
||||
"../../../assets/icons/underlay_frames.svg"
|
||||
)),
|
||||
),
|
||||
("FRAMES0", "Frames Off", IconKind::Svg(include_bytes!(
|
||||
"../../../assets/icons/underlay_frames.svg"
|
||||
))),
|
||||
("FRAMES1", "Frames On", IconKind::Svg(include_bytes!(
|
||||
"../../../assets/icons/underlay_frames.svg"
|
||||
))),
|
||||
("FRAMES2", "Frames On, Not Plotted", IconKind::Svg(include_bytes!(
|
||||
"../../../assets/icons/underlay_frames.svg"
|
||||
))),
|
||||
],
|
||||
default: "FRAMES1",
|
||||
},
|
||||
RibbonItem::Tool(snap_underlays::tool()),
|
||||
RibbonItem::LabeledDropdown {
|
||||
id: "UOSNAP_DROPDOWN",
|
||||
label: "Snap to Underlays",
|
||||
icon: snap_underlays::ICON,
|
||||
items: vec![
|
||||
("UOSNAP1", "Snap to Underlays ON", snap_underlays::ICON),
|
||||
("UOSNAP0", "Snap to Underlays OFF", snap_underlays::ICON),
|
||||
],
|
||||
default: "UOSNAP1",
|
||||
},
|
||||
],
|
||||
},
|
||||
// ── Point Cloud ───────────────────────────────────────────────────
|
||||
|
||||
@@ -4,21 +4,8 @@ use acadrust::EntityType;
|
||||
use glam::DVec3;
|
||||
|
||||
use crate::command::{CadCommand, CmdResult, WorkingPlane};
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
use crate::t;
|
||||
|
||||
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()),
|
||||
}
|
||||
}
|
||||
|
||||
pub struct PdfAttachCommand {
|
||||
definition_handle: Handle,
|
||||
plane: WorkingPlane,
|
||||
|
||||
@@ -1,11 +1,3 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
use crate::modules::IconKind;
|
||||
pub const ICON: IconKind =
|
||||
IconKind::Svg(include_bytes!("../../../assets/icons/snap_underlays.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef {
|
||||
id: "UOSNAP",
|
||||
label: "Snap to\nUnderlays",
|
||||
icon: ICON,
|
||||
event: ModuleEvent::Command("UOSNAP".to_string()),
|
||||
}
|
||||
}
|
||||
@@ -26,10 +26,10 @@ use crate::scene::Scene;
|
||||
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef {
|
||||
id: "XATTACH",
|
||||
label: "Attach XREF",
|
||||
id: "ATTACH",
|
||||
label: "Attach",
|
||||
icon: IconKind::Svg(include_bytes!("../../../assets/icons/blocks/insert.svg")),
|
||||
event: ModuleEvent::Command("XATTACH".to_string()),
|
||||
event: ModuleEvent::Command("ATTACH".to_string()),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user