feat: view tab widget toggle commands and unified SVG icon color scheme
Integrate NAVVCUBE, NAVBAR, PROPERTIES, FILETAB, LAYOUTTAB, TOOLPALETTES and SHEETSET commands to toggle UI widgets at runtime. Add 15 new SVG icons for view module tools previously using glyph fallbacks. Restyle all SVG icons to use the established two-color scheme: #e0e0e0 for passive geometry, #4cc9f0 for active/accent elements. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
6a0125e4d6
commit
1ec53a4730
81 changed files with 533 additions and 597 deletions
|
|
@ -3706,6 +3706,41 @@ impl H7CAD {
|
|||
}
|
||||
}
|
||||
|
||||
// ── NAVVCUBE — toggle ViewCube visibility ────────────────────────────
|
||||
"NAVVCUBE" => {
|
||||
return Task::done(Message::ToggleViewCube);
|
||||
}
|
||||
|
||||
// ── NAVBAR — toggle navigation toolbar visibility ────────────────────
|
||||
"NAVBAR" => {
|
||||
return Task::done(Message::ToggleNavbar);
|
||||
}
|
||||
|
||||
// ── PROPERTIES — toggle Properties panel visibility ──────────────────
|
||||
"PROPERTIES" | "PR" | "PROPS" => {
|
||||
return Task::done(Message::ToggleProperties);
|
||||
}
|
||||
|
||||
// ── FILETAB — toggle file/document tabs ──────────────────────────────
|
||||
"FILETAB" => {
|
||||
return Task::done(Message::ToggleFileTabs);
|
||||
}
|
||||
|
||||
// ── LAYOUTTAB — toggle layout/paper-space tabs ───────────────────────
|
||||
"LAYOUTTAB" => {
|
||||
return Task::done(Message::ToggleLayoutTabs);
|
||||
}
|
||||
|
||||
// ── TOOLPALETTES — not yet implemented ───────────────────────────────
|
||||
"TOOLPALETTES" | "TP" => {
|
||||
self.command_line.push_info("TOOLPALETTES: Tool Palettes not yet implemented.");
|
||||
}
|
||||
|
||||
// ── SHEETSET — not yet implemented ───────────────────────────────────
|
||||
"SHEETSET" | "SSM" => {
|
||||
self.command_line.push_info("SHEETSET: Sheet Set Manager not yet implemented.");
|
||||
}
|
||||
|
||||
// ── XDATA — read/write extended entity data ──────────────────────────
|
||||
// XDATA LIST — show all xdata records on selected entities
|
||||
// XDATA SET <app> <str> — append a string xdata value for <app>
|
||||
|
|
|
|||
|
|
@ -53,6 +53,16 @@ pub(super) struct H7CAD {
|
|||
dyn_input: bool,
|
||||
/// Show the UCS icon in the bottom-left corner of model space (UCSICON).
|
||||
show_ucs_icon: bool,
|
||||
/// Whether the ViewCube 3D gizmo is visible in model space (NAVVCUBE).
|
||||
show_viewcube: bool,
|
||||
/// Whether the navigation toolbar is shown in the viewport (NAVBAR).
|
||||
show_navbar: bool,
|
||||
/// Whether the Properties panel is shown on the left (PROPERTIES).
|
||||
show_properties: bool,
|
||||
/// Whether the document file tabs are shown at the top (FILETAB).
|
||||
show_file_tabs: bool,
|
||||
/// Whether the layout/paper-space tabs are shown at the bottom (LAYOUTTAB).
|
||||
show_layout_tabs: bool,
|
||||
/// Last point committed by a drawing command — used as ortho/polar base.
|
||||
last_point: Option<glam::Vec3>,
|
||||
/// OS window Id for the floating Layer Properties Manager (None when closed).
|
||||
|
|
@ -248,6 +258,16 @@ pub enum Message {
|
|||
ToggleSnapEnabled,
|
||||
/// Toggle grid-snap on/off — F9 / SNAP status-bar button.
|
||||
ToggleGridSnap,
|
||||
/// Toggle the ViewCube 3D gizmo visibility (NAVVCUBE).
|
||||
ToggleViewCube,
|
||||
/// Toggle the navigation toolbar visibility (NAVBAR).
|
||||
ToggleNavbar,
|
||||
/// Toggle the Properties panel visibility (PROPERTIES).
|
||||
ToggleProperties,
|
||||
/// Toggle the document file tabs at the top (FILETAB).
|
||||
ToggleFileTabs,
|
||||
/// Toggle the layout tabs at the bottom (LAYOUTTAB).
|
||||
ToggleLayoutTabs,
|
||||
/// Toggle grid display in the viewport — F7 / GRID status-bar button.
|
||||
ToggleGrid,
|
||||
/// Toggle orthogonal drawing constraint — F8 / ORTHO status-bar button.
|
||||
|
|
@ -545,6 +565,11 @@ impl H7CAD {
|
|||
show_grid: false,
|
||||
dyn_input: true,
|
||||
show_ucs_icon: true,
|
||||
show_viewcube: true,
|
||||
show_navbar: true,
|
||||
show_properties: true,
|
||||
show_file_tabs: true,
|
||||
show_layout_tabs: true,
|
||||
last_point: None,
|
||||
layer_window: None,
|
||||
main_window: None,
|
||||
|
|
|
|||
|
|
@ -1878,6 +1878,11 @@ impl H7CAD {
|
|||
Task::none()
|
||||
}
|
||||
Message::ToggleDynInput => { self.dyn_input ^= true; Task::none() }
|
||||
Message::ToggleViewCube => { self.show_viewcube ^= true; Task::none() }
|
||||
Message::ToggleNavbar => { self.show_navbar ^= true; Task::none() }
|
||||
Message::ToggleProperties => { self.show_properties ^= true; Task::none() }
|
||||
Message::ToggleFileTabs => { self.show_file_tabs ^= true; Task::none() }
|
||||
Message::ToggleLayoutTabs => { self.show_layout_tabs ^= true; Task::none() }
|
||||
Message::ToggleOTrack => {
|
||||
self.snapper.otrack_enabled ^= true;
|
||||
if !self.snapper.otrack_enabled {
|
||||
|
|
|
|||
|
|
@ -189,14 +189,9 @@ impl H7CAD {
|
|||
vec![]
|
||||
};
|
||||
|
||||
overlay::selection_overlay(sel, snap_info, grips, grid, ucs_icon, ost_points, tab.last_cursor_screen, !is_paper)
|
||||
overlay::selection_overlay(sel, snap_info, grips, grid, ucs_icon, ost_points, tab.last_cursor_screen, !is_paper && self.show_viewcube)
|
||||
};
|
||||
|
||||
let nav = container(overlay::nav_toolbar())
|
||||
.align_right(Fill)
|
||||
.align_top(Fill)
|
||||
.padding(iced::Padding { top: 148.0, right: 8.0, bottom: 0.0, left: 0.0 });
|
||||
|
||||
let info = container(overlay::info_bar(
|
||||
if is_paper { &tab.scene.current_layout } else { "Custom View" },
|
||||
&tab.visual_style,
|
||||
|
|
@ -216,21 +211,6 @@ impl H7CAD {
|
|||
.on_scroll(Message::ViewportScroll)
|
||||
.on_exit(Message::ViewportExit);
|
||||
|
||||
let cube_click = mouse_area(container(
|
||||
iced::widget::Space::new()
|
||||
.width(iced::Length::Fixed(VIEWCUBE_HIT_SIZE))
|
||||
.height(iced::Length::Fixed(VIEWCUBE_HIT_SIZE)),
|
||||
))
|
||||
.on_move(Message::CursorMoved)
|
||||
.on_press(Message::ViewportClick);
|
||||
|
||||
let cube_click = container(cube_click)
|
||||
.align_right(Fill)
|
||||
.align_top(Fill)
|
||||
.padding(iced::Padding { top: VIEWCUBE_PAD, right: VIEWCUBE_PAD, bottom: 0.0, left: 0.0 })
|
||||
.width(Fill)
|
||||
.height(Fill);
|
||||
|
||||
let bg_color = if is_paper {
|
||||
// Desk color — matches the DESK constant in paper_canvas.rs.
|
||||
Color { r: 0.22, g: 0.24, b: 0.28, a: 1.0 }
|
||||
|
|
@ -270,36 +250,67 @@ impl H7CAD {
|
|||
container(info).width(Fill).height(Fill),
|
||||
selection_overlay,
|
||||
viewport_mouse,
|
||||
nav,
|
||||
cube_click,
|
||||
]
|
||||
.width(Fill)
|
||||
.height(Fill);
|
||||
|
||||
if self.show_navbar {
|
||||
let nav = container(overlay::nav_toolbar())
|
||||
.align_right(Fill)
|
||||
.align_top(Fill)
|
||||
.padding(iced::Padding { top: 148.0, right: 8.0, bottom: 0.0, left: 0.0 });
|
||||
viewport_stack = viewport_stack.push(nav);
|
||||
}
|
||||
|
||||
if self.show_viewcube && !is_paper {
|
||||
let cube_click: Element<'_, Message> = container(
|
||||
mouse_area(container(
|
||||
iced::widget::Space::new()
|
||||
.width(iced::Length::Fixed(VIEWCUBE_HIT_SIZE))
|
||||
.height(iced::Length::Fixed(VIEWCUBE_HIT_SIZE)),
|
||||
))
|
||||
.on_move(Message::CursorMoved)
|
||||
.on_press(Message::ViewportClick),
|
||||
)
|
||||
.align_right(Fill)
|
||||
.align_top(Fill)
|
||||
.padding(iced::Padding { top: VIEWCUBE_PAD, right: VIEWCUBE_PAD, bottom: 0.0, left: 0.0 })
|
||||
.width(Fill)
|
||||
.height(Fill)
|
||||
.into();
|
||||
viewport_stack = viewport_stack.push(cube_click);
|
||||
}
|
||||
|
||||
if let Some(dyn_ol) = dyn_input_overlay {
|
||||
viewport_stack = viewport_stack.push(dyn_ol);
|
||||
}
|
||||
|
||||
let properties_el: Element<'_, Message> = if self.show_properties {
|
||||
tab.properties.view()
|
||||
} else {
|
||||
Space::new().into()
|
||||
};
|
||||
|
||||
let center_stack = iced::widget::stack![
|
||||
row![tab.properties.view(), viewport_stack]
|
||||
row![properties_el, viewport_stack]
|
||||
.width(Fill)
|
||||
.height(Fill),
|
||||
]
|
||||
.width(Fill)
|
||||
.height(Fill);
|
||||
|
||||
let tab_bar = doc_tab_bar(&self.tabs, self.active_tab);
|
||||
|
||||
let main_ui = container(
|
||||
column![
|
||||
self.ribbon.view(
|
||||
is_paper,
|
||||
self.tabs[self.active_tab].history.undo_stack.len(),
|
||||
self.tabs[self.active_tab].history.redo_stack.len(),
|
||||
),
|
||||
tab_bar,
|
||||
center_stack,
|
||||
self.command_line.view(),
|
||||
self.status_bar.view(
|
||||
let main_ui = container({
|
||||
let mut col = column![self.ribbon.view(
|
||||
is_paper,
|
||||
self.tabs[self.active_tab].history.undo_stack.len(),
|
||||
self.tabs[self.active_tab].history.redo_stack.len(),
|
||||
)];
|
||||
if self.show_file_tabs {
|
||||
col = col.push(doc_tab_bar(&self.tabs, self.active_tab));
|
||||
}
|
||||
col.push(center_stack)
|
||||
.push(self.command_line.view())
|
||||
.push(self.status_bar.view(
|
||||
&self.snapper,
|
||||
self.snap_popup_open,
|
||||
self.ortho_mode,
|
||||
|
|
@ -314,11 +325,11 @@ impl H7CAD {
|
|||
tab.scene.first_viewport_scale(),
|
||||
tab.scene.viewport_count(),
|
||||
tab.scene.active_viewport.is_some(),
|
||||
)
|
||||
]
|
||||
.width(Fill)
|
||||
.height(Fill),
|
||||
)
|
||||
self.show_layout_tabs,
|
||||
))
|
||||
.width(Fill)
|
||||
.height(Fill)
|
||||
})
|
||||
.style(|_: &Theme| container::Style {
|
||||
background: Some(Background::Color(Color { r: 0.11, g: 0.11, b: 0.11, a: 1.0 })),
|
||||
..Default::default()
|
||||
|
|
|
|||
Loading…
Reference in a new issue