diff --git a/locales/en-US/opencadstudio.ftl b/locales/en-US/opencadstudio.ftl index 73857ab56..fdcd0120e 100644 --- a/locales/en-US/opencadstudio.ftl +++ b/locales/en-US/opencadstudio.ftl @@ -3849,6 +3849,7 @@ insert = .display-and-plot-frames = Display and plot frames .display-not-plot-frames = Display but don't plot frames .frames-vary = *Frames vary* + .underlay-osnaps-vary = *Underlay OSnap's vary* .regenerating-model = Regenerating model. .requires-int-0-2 = Requires an integer between 0 and 2. .insert-prompt-hint = INSERT __ocs_arg_prompt____ocs_arg_hint__: diff --git a/locales/tr-TR/opencadstudio.ftl b/locales/tr-TR/opencadstudio.ftl index 142306fc3..fe5a57826 100644 --- a/locales/tr-TR/opencadstudio.ftl +++ b/locales/tr-TR/opencadstudio.ftl @@ -3818,6 +3818,7 @@ insert = .display-and-plot-frames = Çerçeveleri göster ve çizdir .display-not-plot-frames = Çerçeveleri göster, çizdirme .frames-vary = *Çerçeveler farklı* + .underlay-osnaps-vary = *Altlık nesne yakalamaları farklı* .regenerating-model = Model yeniden oluşturuluyor. .requires-int-0-2 = 0 ile 2 arasında bir tamsayı gerekli. .insert-prompt-hint = INSERT __ocs_arg_prompt____ocs_arg_hint__: diff --git a/src/app/update/mod.rs b/src/app/update/mod.rs index 6f88b92ca..184afbe13 100644 --- a/src/app/update/mod.rs +++ b/src/app/update/mod.rs @@ -362,6 +362,12 @@ impl OpenCADStudio { _ => "FRAMES3", }; 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 { 0 => "ATTMODE0", 2 => "ATTMODE2", diff --git a/src/locale_catalog.rs b/src/locale_catalog.rs index d4ecde9fa..cf1c8b557 100644 --- a/src/locale_catalog.rs +++ b/src/locale_catalog.rs @@ -1601,6 +1601,7 @@ pub(super) fn message_attribute(source: &str) -> Option<(&'static str, &'static "Display and plot frames" => Some(("insert", "display-and-plot-frames")), "Display but don't plot frames" => Some(("insert", "display-not-plot-frames")), "*Frames vary*" => Some(("insert", "frames-vary")), + "*Underlay OSnap's vary*" => Some(("insert", "underlay-osnaps-vary")), "Regenerating model." => Some(("insert", "regenerating-model")), "Requires an integer between 0 and 2." => Some(("insert", "requires-int-0-2")), "Frames On, Not Plotted" => Some(("draw", "frames-on-not-plotted")), diff --git a/src/modules/insert/mod.rs b/src/modules/insert/mod.rs index 19b88737b..87f1f630b 100644 --- a/src/modules/insert/mod.rs +++ b/src/modules/insert/mod.rs @@ -50,55 +50,6 @@ impl CadModule for InsertModule { static GROUPS: std::sync::OnceLock> = 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", diff --git a/src/ui/ribbon/widgets.rs b/src/ui/ribbon/widgets.rs index 989ea879b..316d252c2 100644 --- a/src/ui/ribbon/widgets.rs +++ b/src/ui/ribbon/widgets.rs @@ -99,7 +99,7 @@ thread_local! { /// Dropdown items that report a state and cannot be picked. pub(super) fn is_disabled_item(cmd: &str) -> bool { - cmd == "FRAMES3" + matches!(cmd, "FRAMES3" | "UOSNAP2") } fn ribbon_label_bounds(