forked from 1b-agent/opencadstudio-upstream
feat: redesign View tab and fix Annotate/tab order
- Redesign View ribbon tab with 8 groups matching AutoCAD layout: Viewport Tools (UCS Icon, ViewCube, Navigation Bar), Navigate, Model Viewports (Viewport Configuration, Named, Join, Restore), Visual Style (dropdown), Projection, Preset, Palettes (Tool Palettes, Properties, Sheet Set Manager), Interface (File Tabs, Layout Tabs, Tile Horiz/Vert, Cascade) - Add Extract Data and Link Data tools to Annotate → Tables group - Fix tab order to Home → Insert → Annotate → View → Manage via build.rs PRIORITY list - Add 17 new SVG icons for all new commands Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
1 parent
c8991bcc5a
commit
e3bce16545
38 files changed
+354
-19
No files matched your search
@@ -0,0 +1,14 @@
|
||||
// DATAEXTRACTION command — launches the Data Extraction wizard.
|
||||
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/data_extract.svg"));
|
||||
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef {
|
||||
id: "DATAEXTRACTION",
|
||||
label: "Extract\nData",
|
||||
icon: ICON,
|
||||
event: ModuleEvent::Command("DATAEXTRACTION".to_string()),
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// DATALINK command — manages data links to external spreadsheets.
|
||||
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/data_link.svg"));
|
||||
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef {
|
||||
id: "DATALINK",
|
||||
label: "Link\nData",
|
||||
icon: ICON,
|
||||
event: ModuleEvent::Command("DATALINK".to_string()),
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
// Annotate module — dimension, text, leader, table, and markup tools.
|
||||
|
||||
pub mod aligned_dim;
|
||||
pub mod data_extract;
|
||||
pub mod data_link;
|
||||
pub mod angular_dim;
|
||||
pub mod ddedit;
|
||||
pub mod diameter_dim;
|
||||
@@ -152,7 +154,12 @@ impl CadModule for AnnotateModule {
|
||||
style_key: StyleKey::TableStyle,
|
||||
combo_id: "TABLE_STYLE_COMBO",
|
||||
manager_cmd: Some("TABLESTYLE"),
|
||||
rows: vec![],
|
||||
rows: vec![
|
||||
vec![
|
||||
data_extract::tool(),
|
||||
data_link::tool(),
|
||||
],
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -8,8 +8,8 @@ use crate::modules::CadModule;
|
||||
pub fn all_modules() -> Vec<Box<dyn CadModule>> {
|
||||
vec![
|
||||
Box::new(super::home::HomeModule),
|
||||
Box::new(super::annotate::AnnotateModule),
|
||||
Box::new(super::insert::InsertModule),
|
||||
Box::new(super::annotate::AnnotateModule),
|
||||
Box::new(super::view::ViewModule),
|
||||
Box::new(super::manage::ManageModule),
|
||||
Box::new(super::layout::LayoutModule),
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/cascade.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "CASCADE", label: "Cascade", icon: ICON, event: ModuleEvent::Command("CASCADE".to_string()) }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/file_tabs.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "FILETAB", label: "File\nTabs", icon: ICON, event: ModuleEvent::Command("FILETAB".to_string()) }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/layout_tabs.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "LAYOUTTAB", label: "Layout\nTabs", icon: ICON, event: ModuleEvent::Command("LAYOUTTAB".to_string()) }
|
||||
}
|
||||
+85
-16
@@ -1,15 +1,30 @@
|
||||
// View module — navigation, visual styles, and viewport presets.
|
||||
// View module — viewport tools, navigation, visual styles, palettes, interface.
|
||||
|
||||
mod cascade;
|
||||
mod file_tabs;
|
||||
mod hidden;
|
||||
mod layout_tabs;
|
||||
mod navbar;
|
||||
mod orbit;
|
||||
mod ortho;
|
||||
mod pan;
|
||||
mod persp;
|
||||
mod properties_palette;
|
||||
mod sheetset;
|
||||
mod solid;
|
||||
mod tile_horiz;
|
||||
mod tile_vert;
|
||||
mod tool_palettes;
|
||||
mod ucs_icon;
|
||||
mod viewcube;
|
||||
mod view_front;
|
||||
mod view_iso;
|
||||
mod view_right;
|
||||
mod view_top;
|
||||
mod vports_config;
|
||||
mod vports_join;
|
||||
mod vports_named;
|
||||
mod vports_restore;
|
||||
mod wireframe;
|
||||
mod xray;
|
||||
mod zoom_ext;
|
||||
@@ -18,7 +33,7 @@ mod zoom_out;
|
||||
pub mod plot_window;
|
||||
pub mod zoom_window;
|
||||
|
||||
use crate::modules::{CadModule, RibbonGroup};
|
||||
use crate::modules::{CadModule, RibbonGroup, RibbonItem};
|
||||
|
||||
pub struct ViewModule;
|
||||
|
||||
@@ -32,40 +47,94 @@ impl CadModule for ViewModule {
|
||||
|
||||
fn ribbon_groups(&self) -> Vec<RibbonGroup> {
|
||||
vec![
|
||||
// ── Viewport Tools ───────────────────────────────────────────────
|
||||
RibbonGroup {
|
||||
title: "Viewport Tools",
|
||||
tools: vec![
|
||||
RibbonItem::LargeTool(ucs_icon::tool()),
|
||||
RibbonItem::LargeTool(viewcube::tool()),
|
||||
RibbonItem::LargeTool(navbar::tool()),
|
||||
],
|
||||
},
|
||||
// ── Navigate ─────────────────────────────────────────────────────
|
||||
RibbonGroup {
|
||||
title: "Navigate",
|
||||
tools: vec![
|
||||
zoom_ext::tool().into(),
|
||||
zoom_in::tool().into(),
|
||||
zoom_out::tool().into(),
|
||||
pan::tool().into(),
|
||||
orbit::tool().into(),
|
||||
RibbonItem::LargeTool(zoom_ext::tool()),
|
||||
RibbonItem::Tool(zoom_in::tool()),
|
||||
RibbonItem::Tool(zoom_out::tool()),
|
||||
RibbonItem::Tool(pan::tool()),
|
||||
RibbonItem::Tool(orbit::tool()),
|
||||
],
|
||||
},
|
||||
// ── Model Viewports ───────────────────────────────────────────────
|
||||
RibbonGroup {
|
||||
title: "Model Viewports",
|
||||
tools: vec![
|
||||
RibbonItem::LargeTool(vports_config::tool()),
|
||||
RibbonItem::Tool(vports_named::tool()),
|
||||
RibbonItem::Tool(vports_join::tool()),
|
||||
RibbonItem::Tool(vports_restore::tool()),
|
||||
],
|
||||
},
|
||||
// ── Visual Style ──────────────────────────────────────────────────
|
||||
RibbonGroup {
|
||||
// WIREFRAME and SOLID ids are special-cased in ribbon.rs
|
||||
// for toggle-state highlighting based on Ribbon::wireframe.
|
||||
title: "Visual Style",
|
||||
tools: vec![
|
||||
wireframe::tool().into(),
|
||||
solid::tool().into(),
|
||||
hidden::tool().into(),
|
||||
xray::tool().into(),
|
||||
RibbonItem::LargeDropdown {
|
||||
id: "VISUAL_STYLE",
|
||||
label: "Visual\nStyle",
|
||||
icon: wireframe::tool().icon,
|
||||
items: vec![
|
||||
("WIREFRAME", "Wireframe", wireframe::tool().icon),
|
||||
("SOLID", "Shaded", solid::tool().icon),
|
||||
("HIDDEN", "Hidden", hidden::tool().icon),
|
||||
("XRAY", "X-Ray", xray::tool().icon),
|
||||
],
|
||||
default: "WIREFRAME",
|
||||
},
|
||||
],
|
||||
},
|
||||
// ── Projection ────────────────────────────────────────────────────
|
||||
RibbonGroup {
|
||||
// ORTHO and PERSP ids are special-cased in ribbon.rs
|
||||
// for toggle-state highlighting based on Camera::projection.
|
||||
title: "Projection",
|
||||
tools: vec![ortho::tool().into(), persp::tool().into()],
|
||||
tools: vec![
|
||||
RibbonItem::LargeTool(ortho::tool()),
|
||||
RibbonItem::LargeTool(persp::tool()),
|
||||
],
|
||||
},
|
||||
// ── Preset Views ──────────────────────────────────────────────────
|
||||
RibbonGroup {
|
||||
title: "Preset",
|
||||
tools: vec![
|
||||
view_top::tool().into(),
|
||||
view_front::tool().into(),
|
||||
view_right::tool().into(),
|
||||
view_iso::tool().into(),
|
||||
RibbonItem::Tool(view_top::tool()),
|
||||
RibbonItem::Tool(view_front::tool()),
|
||||
RibbonItem::Tool(view_right::tool()),
|
||||
RibbonItem::Tool(view_iso::tool()),
|
||||
],
|
||||
},
|
||||
// ── Palettes ──────────────────────────────────────────────────────
|
||||
RibbonGroup {
|
||||
title: "Palettes",
|
||||
tools: vec![
|
||||
RibbonItem::LargeTool(tool_palettes::tool()),
|
||||
RibbonItem::LargeTool(properties_palette::tool()),
|
||||
RibbonItem::LargeTool(sheetset::tool()),
|
||||
],
|
||||
},
|
||||
// ── Interface ─────────────────────────────────────────────────────
|
||||
RibbonGroup {
|
||||
title: "Interface",
|
||||
tools: vec![
|
||||
RibbonItem::LargeTool(file_tabs::tool()),
|
||||
RibbonItem::LargeTool(layout_tabs::tool()),
|
||||
RibbonItem::Tool(tile_horiz::tool()),
|
||||
RibbonItem::Tool(tile_vert::tool()),
|
||||
RibbonItem::Tool(cascade::tool()),
|
||||
],
|
||||
},
|
||||
]
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/navbar.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "NAVBAR", label: "Navigation\nBar", icon: ICON, event: ModuleEvent::Command("NAVBAR".to_string()) }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/properties.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "PROPERTIES", label: "Properties", icon: ICON, event: ModuleEvent::Command("PROPERTIES".to_string()) }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/sheetset.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "SHEETSET", label: "Sheet Set\nManager", icon: ICON, event: ModuleEvent::Command("SHEETSET".to_string()) }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/tile_horiz.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "HORIZONTAL", label: "Tile\nHoriz.", icon: ICON, event: ModuleEvent::Command("HORIZONTAL".to_string()) }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/tile_vert.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "VERTICAL", label: "Tile\nVert.", icon: ICON, event: ModuleEvent::Command("VERTICAL".to_string()) }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/tool_palettes.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "TOOLPALETTES", label: "Tool\nPalettes", icon: ICON, event: ModuleEvent::Command("TOOLPALETTES".to_string()) }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/ucs_icon.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "UCSICON", label: "UCS\nIcon", icon: ICON, event: ModuleEvent::Command("UCSICON".to_string()) }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/viewcube.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "NAVVCUBE", label: "View\nCube", icon: ICON, event: ModuleEvent::Command("NAVVCUBE".to_string()) }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/vports_config.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "VPORTS", label: "Viewport\nConfiguration", icon: ICON, event: ModuleEvent::Command("VPORTS".to_string()) }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/vports_join.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "VPJOIN", label: "Join", icon: ICON, event: ModuleEvent::Command("VPJOIN".to_string()) }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/vports_named.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "VPORTS_NAMED", label: "Named", icon: ICON, event: ModuleEvent::Command("VPORTS".to_string()) }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::modules::{IconKind, ModuleEvent, ToolDef};
|
||||
pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/vports_restore.svg"));
|
||||
pub fn tool() -> ToolDef {
|
||||
ToolDef { id: "VPORTS_RESTORE", label: "Restore", icon: ICON, event: ModuleEvent::Command("VPORTS".to_string()) }
|
||||
}
|
||||
Reference in new issue
Block a user