forked from 1b-agent/opencadstudio-upstream
Merge pull request #1476 from ramox81:codex/insert-reference-panel
This commit is contained in:
commit
0ea8599f86
35 files changed
+357
-55
No files matched your search
+23
-25
@@ -49,41 +49,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 ───────────────────────────────────────────────────
|
||||
|
||||
@@ -20,21 +20,8 @@ use acadrust::{CadDocument, EntityType};
|
||||
use glam::DVec3;
|
||||
|
||||
use crate::command::{CadCommand, CmdOption, CmdResult, InputKind, WorkingPlane};
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
use crate::scene::model::wire_model::WireModel;
|
||||
|
||||
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] = [
|
||||
("MM", "Millimeters"),
|
||||
|
||||
@@ -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