forked from 1b-agent/opencadstudio-upstream
Merge pull request #1753 from ramox81/codex/insert-reference-ribbon
Insert ribbon: Reference panel order and Snap to Underlays state
This commit is contained in:
commit
7d306eec5e
6 files changed
+63
-50
No files matched your search
+53
-49
@@ -50,55 +50,6 @@ impl CadModule for InsertModule {
|
||||
static GROUPS: std::sync::OnceLock<Vec<RibbonGroup>> = std::sync::OnceLock::new();
|
||||
GROUPS.get_or_init(|| {
|
||||
vec![
|
||||
// ── Reference ────────────────────────────────────────────────────
|
||||
RibbonGroup {
|
||||
title: "Reference",
|
||||
tools: vec![
|
||||
RibbonItem::LargeTool(xattach::tool()),
|
||||
// PDF, DWF, DGN or a point cloud; the face runs the
|
||||
// last one chosen.
|
||||
RibbonItem::LargeDropdown {
|
||||
id: "UNDERLAY_ATTACH",
|
||||
label: "Attach Underlay",
|
||||
icon: pdf_attach::ICON,
|
||||
items: vec![
|
||||
("PDFATTACH", "Attach PDF", pdf_attach::ICON),
|
||||
("DWFATTACH", "Attach DWF", pdf_attach::ICON),
|
||||
("DGNATTACH", "Attach DGN", pdf_attach::ICON),
|
||||
("POINTCLOUDATTACH", "Attach Point Cloud", pc_attach::ICON),
|
||||
],
|
||||
default: "PDFATTACH",
|
||||
},
|
||||
RibbonItem::LargeTool(xclip::tool()),
|
||||
RibbonItem::LargeTool(xadjust::tool()),
|
||||
RibbonItem::LabeledTool(underlay_layers::tool()),
|
||||
// An empty label shows the chosen item's.
|
||||
RibbonItem::LabeledDropdown {
|
||||
id: "FRAMES_DROPDOWN",
|
||||
label: "",
|
||||
icon: FRAMES_ICON,
|
||||
items: vec![
|
||||
("FRAMES0", "Hide frames", FRAMES_ICON),
|
||||
("FRAMES1", "Display and plot frames", FRAMES_ICON),
|
||||
("FRAMES2", "Display but don't plot frames", FRAMES_ICON),
|
||||
// Shown (not selectable) while the frame
|
||||
// variables differ from each other.
|
||||
("FRAMES3", "*Frames vary*", FRAMES_ICON),
|
||||
],
|
||||
default: "FRAMES1",
|
||||
},
|
||||
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",
|
||||
},
|
||||
],
|
||||
},
|
||||
// ── Block ─────────────────────────────────────────────────────────
|
||||
RibbonGroup {
|
||||
title: "Block",
|
||||
@@ -139,6 +90,59 @@ impl CadModule for InsertModule {
|
||||
RibbonItem::LargeTool(edit_block::tool()),
|
||||
],
|
||||
},
|
||||
// ── Reference ────────────────────────────────────────────────────
|
||||
RibbonGroup {
|
||||
title: "Reference",
|
||||
tools: vec![
|
||||
RibbonItem::LargeTool(xattach::tool()),
|
||||
// PDF, DWF, DGN or a point cloud; the face runs the
|
||||
// last one chosen.
|
||||
RibbonItem::LargeDropdown {
|
||||
id: "UNDERLAY_ATTACH",
|
||||
label: "Attach Underlay",
|
||||
icon: pdf_attach::ICON,
|
||||
items: vec![
|
||||
("PDFATTACH", "Attach PDF", pdf_attach::ICON),
|
||||
("DWFATTACH", "Attach DWF", pdf_attach::ICON),
|
||||
("DGNATTACH", "Attach DGN", pdf_attach::ICON),
|
||||
("POINTCLOUDATTACH", "Attach Point Cloud", pc_attach::ICON),
|
||||
],
|
||||
default: "PDFATTACH",
|
||||
},
|
||||
RibbonItem::LargeTool(xclip::tool()),
|
||||
RibbonItem::LargeTool(xadjust::tool()),
|
||||
RibbonItem::LabeledTool(underlay_layers::tool()),
|
||||
// An empty label shows the chosen item's.
|
||||
RibbonItem::LabeledDropdown {
|
||||
id: "FRAMES_DROPDOWN",
|
||||
label: "",
|
||||
icon: FRAMES_ICON,
|
||||
items: vec![
|
||||
("FRAMES0", "Hide frames", FRAMES_ICON),
|
||||
("FRAMES1", "Display and plot frames", FRAMES_ICON),
|
||||
("FRAMES2", "Display but don't plot frames", FRAMES_ICON),
|
||||
// Shown (not selectable) while the frame
|
||||
// variables differ from each other.
|
||||
("FRAMES3", "*Frames vary*", FRAMES_ICON),
|
||||
],
|
||||
default: "FRAMES1",
|
||||
},
|
||||
RibbonItem::LabeledDropdown {
|
||||
id: "UOSNAP_DROPDOWN",
|
||||
// An empty label shows the current state.
|
||||
label: "",
|
||||
icon: snap_underlays::ICON,
|
||||
items: vec![
|
||||
("UOSNAP1", "Snap to Underlays ON", snap_underlays::ICON),
|
||||
("UOSNAP0", "Snap to Underlays OFF", snap_underlays::ICON),
|
||||
// Shown (not selectable) while PDFOSNAP, DWFOSNAP
|
||||
// and DGNOSNAP differ (UOSNAP 2).
|
||||
("UOSNAP2", "*Underlay OSnap's vary*", snap_underlays::ICON),
|
||||
],
|
||||
default: "UOSNAP1",
|
||||
},
|
||||
],
|
||||
},
|
||||
// ── Import ────────────────────────────────────────────────────────
|
||||
RibbonGroup {
|
||||
title: "Import",
|
||||
|
||||
Reference in new issue
Block a user