forked from 1b-agent/opencadstudio-upstream
Insert ribbon: Reference panel after Block Definition; Snap to Underlays list follows UOSNAP
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b1d4c9bd9b
commit
042223a09c
6 files changed
+63
-50
No files matched your search
@@ -3779,6 +3779,7 @@ insert =
|
|||||||
.display-and-plot-frames = Display and plot frames
|
.display-and-plot-frames = Display and plot frames
|
||||||
.display-not-plot-frames = Display but don't plot frames
|
.display-not-plot-frames = Display but don't plot frames
|
||||||
.frames-vary = *Frames vary*
|
.frames-vary = *Frames vary*
|
||||||
|
.underlay-osnaps-vary = *Underlay OSnap's vary*
|
||||||
.regenerating-model = Regenerating model.
|
.regenerating-model = Regenerating model.
|
||||||
.requires-int-0-2 = Requires an integer between 0 and 2.
|
.requires-int-0-2 = Requires an integer between 0 and 2.
|
||||||
.insert-prompt-hint = INSERT __ocs_arg_prompt____ocs_arg_hint__:
|
.insert-prompt-hint = INSERT __ocs_arg_prompt____ocs_arg_hint__:
|
||||||
|
|||||||
@@ -3748,6 +3748,7 @@ insert =
|
|||||||
.display-and-plot-frames = Çerçeveleri göster ve çizdir
|
.display-and-plot-frames = Çerçeveleri göster ve çizdir
|
||||||
.display-not-plot-frames = Çerçeveleri göster, çizdirme
|
.display-not-plot-frames = Çerçeveleri göster, çizdirme
|
||||||
.frames-vary = *Çerçeveler farklı*
|
.frames-vary = *Çerçeveler farklı*
|
||||||
|
.underlay-osnaps-vary = *Altlık nesne yakalamaları farklı*
|
||||||
.regenerating-model = Model yeniden oluşturuluyor.
|
.regenerating-model = Model yeniden oluşturuluyor.
|
||||||
.requires-int-0-2 = 0 ile 2 arasında bir tamsayı gerekli.
|
.requires-int-0-2 = 0 ile 2 arasında bir tamsayı gerekli.
|
||||||
.insert-prompt-hint = INSERT __ocs_arg_prompt____ocs_arg_hint__:
|
.insert-prompt-hint = INSERT __ocs_arg_prompt____ocs_arg_hint__:
|
||||||
|
|||||||
@@ -356,6 +356,12 @@ impl OpenCADStudio {
|
|||||||
_ => "FRAMES3",
|
_ => "FRAMES3",
|
||||||
};
|
};
|
||||||
self.ribbon.set_dropdown_current("FRAMES_DROPDOWN", current);
|
self.ribbon.set_dropdown_current("FRAMES_DROPDOWN", current);
|
||||||
|
let uosnap = match crate::scene::model::pdf_vector::uosnap() {
|
||||||
|
0 => "UOSNAP0",
|
||||||
|
1 => "UOSNAP1",
|
||||||
|
_ => "UOSNAP2",
|
||||||
|
};
|
||||||
|
self.ribbon.set_dropdown_current("UOSNAP_DROPDOWN", uosnap);
|
||||||
let attmode = match tab.scene.document.header.attribute_visibility {
|
let attmode = match tab.scene.document.header.attribute_visibility {
|
||||||
0 => "ATTMODE0",
|
0 => "ATTMODE0",
|
||||||
2 => "ATTMODE2",
|
2 => "ATTMODE2",
|
||||||
|
|||||||
@@ -1598,6 +1598,7 @@ pub(super) fn message_attribute(source: &str) -> Option<(&'static str, &'static
|
|||||||
"Display and plot frames" => Some(("insert", "display-and-plot-frames")),
|
"Display and plot frames" => Some(("insert", "display-and-plot-frames")),
|
||||||
"Display but don't plot frames" => Some(("insert", "display-not-plot-frames")),
|
"Display but don't plot frames" => Some(("insert", "display-not-plot-frames")),
|
||||||
"*Frames vary*" => Some(("insert", "frames-vary")),
|
"*Frames vary*" => Some(("insert", "frames-vary")),
|
||||||
|
"*Underlay OSnap's vary*" => Some(("insert", "underlay-osnaps-vary")),
|
||||||
"Regenerating model." => Some(("insert", "regenerating-model")),
|
"Regenerating model." => Some(("insert", "regenerating-model")),
|
||||||
"Requires an integer between 0 and 2." => Some(("insert", "requires-int-0-2")),
|
"Requires an integer between 0 and 2." => Some(("insert", "requires-int-0-2")),
|
||||||
"Frames On, Not Plotted" => Some(("draw", "frames-on-not-plotted")),
|
"Frames On, Not Plotted" => Some(("draw", "frames-on-not-plotted")),
|
||||||
|
|||||||
+53
-49
@@ -50,55 +50,6 @@ impl CadModule for InsertModule {
|
|||||||
static GROUPS: std::sync::OnceLock<Vec<RibbonGroup>> = std::sync::OnceLock::new();
|
static GROUPS: std::sync::OnceLock<Vec<RibbonGroup>> = std::sync::OnceLock::new();
|
||||||
GROUPS.get_or_init(|| {
|
GROUPS.get_or_init(|| {
|
||||||
vec![
|
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 ─────────────────────────────────────────────────────────
|
// ── Block ─────────────────────────────────────────────────────────
|
||||||
RibbonGroup {
|
RibbonGroup {
|
||||||
title: "Block",
|
title: "Block",
|
||||||
@@ -139,6 +90,59 @@ impl CadModule for InsertModule {
|
|||||||
RibbonItem::LargeTool(edit_block::tool()),
|
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 ────────────────────────────────────────────────────────
|
// ── Import ────────────────────────────────────────────────────────
|
||||||
RibbonGroup {
|
RibbonGroup {
|
||||||
title: "Import",
|
title: "Import",
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ thread_local! {
|
|||||||
|
|
||||||
/// Dropdown items that report a state and cannot be picked.
|
/// Dropdown items that report a state and cannot be picked.
|
||||||
pub(super) fn is_disabled_item(cmd: &str) -> bool {
|
pub(super) fn is_disabled_item(cmd: &str) -> bool {
|
||||||
cmd == "FRAMES3"
|
matches!(cmd, "FRAMES3" | "UOSNAP2")
|
||||||
}
|
}
|
||||||
|
|
||||||
fn ribbon_label_bounds(
|
fn ribbon_label_bounds(
|
||||||
|
|||||||
Reference in new issue
Block a user