From ec14c98f07cc6bd7a42befe7e04a6e7fea8fc790 Mon Sep 17 00:00:00 2001 From: ramox81 <184937705+ramox81@users.noreply.github.com> Date: Mon, 14 Sep 2026 21:59:20 +0300 Subject: [PATCH] fix(annotate): keep tools in their ribbon tab --- src/ui/ribbon/annotation_panel.rs | 170 ------------------------------ src/ui/ribbon/draw_panel.rs | 6 -- src/ui/ribbon/mod.rs | 1 - 3 files changed, 177 deletions(-) delete mode 100644 src/ui/ribbon/annotation_panel.rs diff --git a/src/ui/ribbon/annotation_panel.rs b/src/ui/ribbon/annotation_panel.rs deleted file mode 100644 index 7b0a8839c..000000000 --- a/src/ui/ribbon/annotation_panel.rs +++ /dev/null @@ -1,170 +0,0 @@ -//! Additional annotation tools reached from the Draw tab's Annotation panel title. - -use super::draw_panel::Tool; - -pub(super) const TOOLS: &[Tool] = &[ - Tool { - command: "DDEDIT", - label: "Edit Text", - icon: include_bytes!("../../../assets/icons/ddedit.svg"), - options: &[], - }, - Tool { - command: "TOLERANCE", - label: "Geometric Tolerance", - icon: include_bytes!("../../../assets/icons/tolerance.svg"), - options: &[], - }, - Tool { - command: "DIMALIGNED", - label: "Aligned Dimension", - icon: include_bytes!("../../../assets/icons/dim_aligned.svg"), - options: &[], - }, - Tool { - command: "DIMARC", - label: "Arc Length Dimension", - icon: include_bytes!("../../../assets/icons/dim_angular.svg"), - options: &[], - }, - Tool { - command: "DIMJOGGED", - label: "Jogged Radius Dimension", - icon: include_bytes!("../../../assets/icons/dim_jog.svg"), - options: &[], - }, - Tool { - command: "DIMDIAMETER", - label: "Diameter Dimension", - icon: include_bytes!("../../../assets/icons/dim_diameter.svg"), - options: &[], - }, - Tool { - command: "DIMORDINATE", - label: "Ordinate Dimension", - icon: include_bytes!("../../../assets/icons/dim_ordinate.svg"), - options: &[], - }, - Tool { - command: "QDIM", - label: "Quick Dimension", - icon: include_bytes!("../../../assets/icons/qdim.svg"), - options: &[], - }, - Tool { - command: "DIMCONTINUE", - label: "Continue Dimension", - icon: include_bytes!("../../../assets/icons/dim_continue.svg"), - options: &[], - }, - Tool { - command: "DIMBASELINE", - label: "Baseline Dimension", - icon: include_bytes!("../../../assets/icons/dim_baseline.svg"), - options: &[], - }, - Tool { - command: "DIMBREAK", - label: "Dimension Break", - icon: include_bytes!("../../../assets/icons/dim_break.svg"), - options: &[], - }, - Tool { - command: "DIMEDIT", - label: "Edit Dimension", - icon: include_bytes!("../../../assets/icons/dim_edit.svg"), - options: &[], - }, - Tool { - command: "DIMTEDIT", - label: "Edit Dimension Text", - icon: include_bytes!("../../../assets/icons/dim_tedit.svg"), - options: &[], - }, - Tool { - command: "DIMSPACE", - label: "Adjust Dimension Space", - icon: include_bytes!("../../../assets/icons/dim_space.svg"), - options: &[], - }, - Tool { - command: "DIMJOGLINE", - label: "Add or Remove Jog Line", - icon: include_bytes!("../../../assets/icons/dim_jog.svg"), - options: &[], - }, - Tool { - command: "MLEADERADD", - label: "Add Leader", - icon: include_bytes!("../../../assets/icons/mleader_add.svg"), - options: &[], - }, - Tool { - command: "MLEADERREMOVE", - label: "Remove Leader", - icon: include_bytes!("../../../assets/icons/mleader_remove.svg"), - options: &[], - }, - Tool { - command: "MLEADERALIGN", - label: "Align Leaders", - icon: include_bytes!("../../../assets/icons/mleader_align.svg"), - options: &[], - }, - Tool { - command: "MLEADERCOLLECT", - label: "Collect Leaders", - icon: include_bytes!("../../../assets/icons/mleader_collect.svg"), - options: &[], - }, - Tool { - command: "WIPEOUT", - label: "Wipeout", - icon: include_bytes!("../../../assets/icons/wipeout.svg"), - options: &[], - }, - Tool { - command: "TABLE", - label: "Table and Data", - icon: include_bytes!("../../../assets/icons/table.svg"), - options: &[ - ("TABLE", "Table"), - ("DATALINK", "Link Data"), - ("DATAEXTRACTION", "Extract Data"), - ], - }, - Tool { - command: "CENTERMARK", - label: "Center Mark and Line", - icon: include_bytes!("../../../assets/icons/line.svg"), - options: &[ - ("CENTERMARK", "Center Mark"), - ("CENTERLINE", "Center Line"), - ("CENTERREASSOCIATE", "Reassociate Center Object"), - ("CENTERDISASSOCIATE", "Disassociate Center Object"), - ("CENTERRESET", "Reset Center Object"), - ], - }, - Tool { - command: "REVCLOUD", - label: "Revision Cloud", - icon: include_bytes!("../../../assets/icons/revcloud.svg"), - options: &[ - ("REVCLOUD_RECTANGULAR", "Rectangular"), - ("REVCLOUD_POLYGONAL", "Polygonal"), - ("REVCLOUD_FREEHAND", "Freehand"), - ], - }, - Tool { - command: "OBJECTSCALE", - label: "Annotation Scales", - icon: include_bytes!("../../../assets/icons/add_scale.svg"), - options: &[ - ("OBJECTSCALE ADD", "Add Current Scale"), - ("OBJECTSCALE DELETE", "Delete Current Scale"), - ("OBJECTSCALE", "Add or Delete Scales"), - ("SCALELISTEDIT", "Edit Scale List"), - ("ANNORESET", "Sync Scale Positions"), - ], - }, -]; diff --git a/src/ui/ribbon/draw_panel.rs b/src/ui/ribbon/draw_panel.rs index 897dd528a..f2e4677c4 100644 --- a/src/ui/ribbon/draw_panel.rs +++ b/src/ui/ribbon/draw_panel.rs @@ -140,12 +140,6 @@ const PANELS: &[Panel] = &[ title: "Modify", tools: super::modify_panel::TOOLS, }, - Panel { - id: "annotation_extension", - title_id: "annotation_extension_title", - title: "Annotation", - tools: super::annotation_panel::TOOLS, - }, ]; fn panel_for_dropdown(id: &str) -> Option { diff --git a/src/ui/ribbon/mod.rs b/src/ui/ribbon/mod.rs index d57cf6c22..a5eb2ffe3 100644 --- a/src/ui/ribbon/mod.rs +++ b/src/ui/ribbon/mod.rs @@ -21,7 +21,6 @@ use crate::plugin::all_ribbon_modules; use crate::ui::properties::{linetype_display_name, lw_options, LinetypeItem}; mod widgets; -mod annotation_panel; mod draw_panel; mod modify_panel; use widgets::{StyleContext, *};