diff --git a/assets/icons/about.svg b/assets/icons/about.svg index 7c3b9c03d..c4258f915 100644 --- a/assets/icons/about.svg +++ b/assets/icons/about.svg @@ -1,8 +1,5 @@ - - - - - - - + + + + diff --git a/assets/icons/attdef.svg b/assets/icons/attdef.svg index 39ea57ba6..44e561a8a 100644 --- a/assets/icons/attdef.svg +++ b/assets/icons/attdef.svg @@ -1,10 +1,5 @@ - - - - - - A - - - + + + + @ diff --git a/assets/icons/attedit.svg b/assets/icons/attedit.svg index 4712ed383..4eb1da01f 100644 --- a/assets/icons/attedit.svg +++ b/assets/icons/attedit.svg @@ -1,10 +1,7 @@ - - - - - - - - - + + + + + + diff --git a/assets/icons/attman.svg b/assets/icons/attman.svg index c93a0f785..4a836c7e1 100644 --- a/assets/icons/attman.svg +++ b/assets/icons/attman.svg @@ -1,15 +1,7 @@ - - - - - - - - - - - - - - + + + + + + diff --git a/assets/icons/attsync.svg b/assets/icons/attsync.svg index 889a73e7d..ce849bf92 100644 --- a/assets/icons/attsync.svg +++ b/assets/icons/attsync.svg @@ -1,9 +1,6 @@ - - - - - - - - + + + + + diff --git a/assets/icons/audit.svg b/assets/icons/audit.svg index 7e0bcd4ec..63d524085 100644 --- a/assets/icons/audit.svg +++ b/assets/icons/audit.svg @@ -1,10 +1,5 @@ - - - - - - - - - + + + + diff --git a/assets/icons/base_point.svg b/assets/icons/base_point.svg index abd504ae6..817a64dff 100644 --- a/assets/icons/base_point.svg +++ b/assets/icons/base_point.svg @@ -1,7 +1,5 @@ - - - - - - + + + + diff --git a/assets/icons/cascade.svg b/assets/icons/cascade.svg index ce7f11b19..009e830a1 100644 --- a/assets/icons/cascade.svg +++ b/assets/icons/cascade.svg @@ -1,6 +1,5 @@ - - - - - + + + + diff --git a/assets/icons/changelog.svg b/assets/icons/changelog.svg index 0779b6361..8350e1c50 100644 --- a/assets/icons/changelog.svg +++ b/assets/icons/changelog.svg @@ -1,9 +1,5 @@ - - - - - - - - + + + + diff --git a/assets/icons/content_browser.svg b/assets/icons/content_browser.svg index 80bc95f1d..6a287738b 100644 --- a/assets/icons/content_browser.svg +++ b/assets/icons/content_browser.svg @@ -1,13 +1,7 @@ - - - - - - - - - - - - + + + + + + diff --git a/assets/icons/cui_export.svg b/assets/icons/cui_export.svg index e967690e0..d6a355f97 100644 --- a/assets/icons/cui_export.svg +++ b/assets/icons/cui_export.svg @@ -1,9 +1,7 @@ - - - - - - - - + + + + + + diff --git a/assets/icons/cui_import.svg b/assets/icons/cui_import.svg index 32aec0259..8801827cf 100644 --- a/assets/icons/cui_import.svg +++ b/assets/icons/cui_import.svg @@ -1,8 +1,7 @@ - - - - - - - + + + + + + diff --git a/assets/icons/data_extract.svg b/assets/icons/data_extract.svg index ddcb26568..b4eb148d5 100644 --- a/assets/icons/data_extract.svg +++ b/assets/icons/data_extract.svg @@ -1,10 +1,9 @@ - - - - - - - - - + + + + + + + + diff --git a/assets/icons/data_link.svg b/assets/icons/data_link.svg index ff265870b..afe5bf7b4 100644 --- a/assets/icons/data_link.svg +++ b/assets/icons/data_link.svg @@ -1,11 +1,7 @@ - - - - - - - - - - + + + + + + diff --git a/assets/icons/design_center.svg b/assets/icons/design_center.svg index 44cac1f1d..449f5195d 100644 --- a/assets/icons/design_center.svg +++ b/assets/icons/design_center.svg @@ -1,16 +1,10 @@ - - - - - - - - - - - - - - - + + + + + + + + + diff --git a/assets/icons/edit_aliases.svg b/assets/icons/edit_aliases.svg index f13172e32..232b545bf 100644 --- a/assets/icons/edit_aliases.svg +++ b/assets/icons/edit_aliases.svg @@ -1,16 +1,8 @@ - - - - - - - - - - - - - - - + + + + A→a + + + diff --git a/assets/icons/edit_block.svg b/assets/icons/edit_block.svg index 0212d5245..8a78ce797 100644 --- a/assets/icons/edit_block.svg +++ b/assets/icons/edit_block.svg @@ -1,9 +1,9 @@ - - - - - - - - + + + + + + + + diff --git a/assets/icons/erase.svg b/assets/icons/erase.svg index 31877dff5..a8e27d645 100644 --- a/assets/icons/erase.svg +++ b/assets/icons/erase.svg @@ -1,45 +1,5 @@ - - - - - - - - - + + + + diff --git a/assets/icons/file_tabs.svg b/assets/icons/file_tabs.svg index e33a0acd1..b37e0863a 100644 --- a/assets/icons/file_tabs.svg +++ b/assets/icons/file_tabs.svg @@ -1,11 +1,8 @@ - - - - - - - - - - + + + + + + + diff --git a/assets/icons/find_nonpurgeable.svg b/assets/icons/find_nonpurgeable.svg index bbb0cb507..1d18fec12 100644 --- a/assets/icons/find_nonpurgeable.svg +++ b/assets/icons/find_nonpurgeable.svg @@ -1,8 +1,7 @@ - - - - - - - + + + + + + diff --git a/assets/icons/hidden.svg b/assets/icons/hidden.svg new file mode 100644 index 000000000..fe9aa9e08 --- /dev/null +++ b/assets/icons/hidden.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/icons/landxml.svg b/assets/icons/landxml.svg index 995608a65..a38da9f01 100644 --- a/assets/icons/landxml.svg +++ b/assets/icons/landxml.svg @@ -1,6 +1,7 @@ - - - - - <XML> + + + + + + diff --git a/assets/icons/layout_tabs.svg b/assets/icons/layout_tabs.svg index 4758ae242..ab9cdac79 100644 --- a/assets/icons/layout_tabs.svg +++ b/assets/icons/layout_tabs.svg @@ -1,9 +1,6 @@ - - - - - - - - + + + + + diff --git a/assets/icons/mview_block.svg b/assets/icons/mview_block.svg index b4461f7c9..853b81f08 100644 --- a/assets/icons/mview_block.svg +++ b/assets/icons/mview_block.svg @@ -1,14 +1,7 @@ - - - - - - - - - - - - - + + + + + + diff --git a/assets/icons/navbar.svg b/assets/icons/navbar.svg index 75c94d7ae..37806166c 100644 --- a/assets/icons/navbar.svg +++ b/assets/icons/navbar.svg @@ -1,10 +1,8 @@ - - - - - - - - - N + + + + + + + N diff --git a/assets/icons/orbit.svg b/assets/icons/orbit.svg new file mode 100644 index 000000000..d9a6a9a4c --- /dev/null +++ b/assets/icons/orbit.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/icons/ortho.svg b/assets/icons/ortho.svg new file mode 100644 index 000000000..5d985b184 --- /dev/null +++ b/assets/icons/ortho.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/icons/overkill.svg b/assets/icons/overkill.svg index 9670a2cb1..302ca0254 100644 --- a/assets/icons/overkill.svg +++ b/assets/icons/overkill.svg @@ -1,8 +1,11 @@ - - - - - - - + + + + + + + + + + diff --git a/assets/icons/pan.svg b/assets/icons/pan.svg new file mode 100644 index 000000000..52eb56ce1 --- /dev/null +++ b/assets/icons/pan.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/icons/pc_attach.svg b/assets/icons/pc_attach.svg index 2be95de71..679d7c3a0 100644 --- a/assets/icons/pc_attach.svg +++ b/assets/icons/pc_attach.svg @@ -1,14 +1,8 @@ - - - - - - - - - - - - - + + + + + + + diff --git a/assets/icons/persp.svg b/assets/icons/persp.svg new file mode 100644 index 000000000..b9e1e6f06 --- /dev/null +++ b/assets/icons/persp.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/icons/properties.svg b/assets/icons/properties.svg index 76cc8b652..eebf850c3 100644 --- a/assets/icons/properties.svg +++ b/assets/icons/properties.svg @@ -1,15 +1,11 @@ - - - - - - - - - - - - - - + + + + + + + + + + diff --git a/assets/icons/purge.svg b/assets/icons/purge.svg index cc57f88d0..34da005f9 100644 --- a/assets/icons/purge.svg +++ b/assets/icons/purge.svg @@ -1,10 +1,7 @@ - - - - - - - - - + + + + + + diff --git a/assets/icons/recap.svg b/assets/icons/recap.svg index ab985ca10..009d51a79 100644 --- a/assets/icons/recap.svg +++ b/assets/icons/recap.svg @@ -1,18 +1,8 @@ - - - - - - - - - - - - - - - - - + + + + + + + diff --git a/assets/icons/report.svg b/assets/icons/report.svg index b51e1b251..bfac2c93a 100644 --- a/assets/icons/report.svg +++ b/assets/icons/report.svg @@ -1,17 +1,7 @@ - - - - - - - - - - - - - - - - + + + + + + diff --git a/assets/icons/sheetset.svg b/assets/icons/sheetset.svg index 41ec42d8d..4d2f89ab6 100644 --- a/assets/icons/sheetset.svg +++ b/assets/icons/sheetset.svg @@ -1,9 +1,7 @@ - - - - - - - - + + + + + + diff --git a/assets/icons/snap_underlays.svg b/assets/icons/snap_underlays.svg index 634427a51..f36b60248 100644 --- a/assets/icons/snap_underlays.svg +++ b/assets/icons/snap_underlays.svg @@ -1,10 +1,10 @@ - - - - - - - - - + + + + + + + + + diff --git a/assets/icons/solid.svg b/assets/icons/solid.svg new file mode 100644 index 000000000..fd7505137 --- /dev/null +++ b/assets/icons/solid.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/icons/tile_horiz.svg b/assets/icons/tile_horiz.svg index 0b9c0308d..f86261b00 100644 --- a/assets/icons/tile_horiz.svg +++ b/assets/icons/tile_horiz.svg @@ -1,5 +1,4 @@ - - - - + + + diff --git a/assets/icons/tile_vert.svg b/assets/icons/tile_vert.svg index 3c14ed76b..eab8b11c0 100644 --- a/assets/icons/tile_vert.svg +++ b/assets/icons/tile_vert.svg @@ -1,5 +1,4 @@ - - - - + + + diff --git a/assets/icons/tool_palettes.svg b/assets/icons/tool_palettes.svg index 474f76b64..575628e3d 100644 --- a/assets/icons/tool_palettes.svg +++ b/assets/icons/tool_palettes.svg @@ -1,15 +1,11 @@ - - - - - - - - - - - - - - + + + + + + + + + + diff --git a/assets/icons/ucs_icon.svg b/assets/icons/ucs_icon.svg index ff12a0b39..bb892018d 100644 --- a/assets/icons/ucs_icon.svg +++ b/assets/icons/ucs_icon.svg @@ -1,10 +1,8 @@ - - - - - X - - - - Y + + + + X + + + Y diff --git a/assets/icons/underlay_frames.svg b/assets/icons/underlay_frames.svg index 1431a9d79..2b3a7e80d 100644 --- a/assets/icons/underlay_frames.svg +++ b/assets/icons/underlay_frames.svg @@ -1,13 +1,4 @@ - - - - - - - - - - - - + + + diff --git a/assets/icons/underlay_layers.svg b/assets/icons/underlay_layers.svg index 42197e16a..06c8c4741 100644 --- a/assets/icons/underlay_layers.svg +++ b/assets/icons/underlay_layers.svg @@ -1,6 +1,5 @@ - - - - - + + + + diff --git a/assets/icons/user_interface.svg b/assets/icons/user_interface.svg index 87826d6c1..5fd18768c 100644 --- a/assets/icons/user_interface.svg +++ b/assets/icons/user_interface.svg @@ -1,12 +1,8 @@ - - - - - - - - - - - + + + + + + + diff --git a/assets/icons/view_front.svg b/assets/icons/view_front.svg new file mode 100644 index 000000000..7cb63a5fa --- /dev/null +++ b/assets/icons/view_front.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/icons/view_iso.svg b/assets/icons/view_iso.svg new file mode 100644 index 000000000..49ca77ee5 --- /dev/null +++ b/assets/icons/view_iso.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/icons/view_right.svg b/assets/icons/view_right.svg new file mode 100644 index 000000000..7dce99900 --- /dev/null +++ b/assets/icons/view_right.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/icons/view_top.svg b/assets/icons/view_top.svg new file mode 100644 index 000000000..faf919738 --- /dev/null +++ b/assets/icons/view_top.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/icons/viewcube.svg b/assets/icons/viewcube.svg index 071fcf9f7..525a60b75 100644 --- a/assets/icons/viewcube.svg +++ b/assets/icons/viewcube.svg @@ -1,8 +1,5 @@ - - - - - - - + + + + diff --git a/assets/icons/vports_config.svg b/assets/icons/vports_config.svg index ae1132b36..8eb840320 100644 --- a/assets/icons/vports_config.svg +++ b/assets/icons/vports_config.svg @@ -1,7 +1,6 @@ - - - - - - + + + + + diff --git a/assets/icons/vports_join.svg b/assets/icons/vports_join.svg index 208e25e03..e00de0e84 100644 --- a/assets/icons/vports_join.svg +++ b/assets/icons/vports_join.svg @@ -1,10 +1,7 @@ - - - - - - - - - + + + + + + diff --git a/assets/icons/vports_named.svg b/assets/icons/vports_named.svg index 0609c79cc..0e393ab56 100644 --- a/assets/icons/vports_named.svg +++ b/assets/icons/vports_named.svg @@ -1,8 +1,6 @@ - - - - - - - + + + + + diff --git a/assets/icons/vports_restore.svg b/assets/icons/vports_restore.svg index cbf2baabf..6ac1154e2 100644 --- a/assets/icons/vports_restore.svg +++ b/assets/icons/vports_restore.svg @@ -1,7 +1,5 @@ - - - - - - + + + + diff --git a/assets/icons/wireframe.svg b/assets/icons/wireframe.svg new file mode 100644 index 000000000..c67cf717c --- /dev/null +++ b/assets/icons/wireframe.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/icons/xadjust.svg b/assets/icons/xadjust.svg index f0df2763d..58f405c5e 100644 --- a/assets/icons/xadjust.svg +++ b/assets/icons/xadjust.svg @@ -1,8 +1,8 @@ - - - - - - - + + + + + + + diff --git a/assets/icons/xclip.svg b/assets/icons/xclip.svg index f6b6629f3..c6ae05f33 100644 --- a/assets/icons/xclip.svg +++ b/assets/icons/xclip.svg @@ -1,10 +1,6 @@ - - - - - - - - - + + + + + diff --git a/assets/icons/xray.svg b/assets/icons/xray.svg new file mode 100644 index 000000000..dce0ff17d --- /dev/null +++ b/assets/icons/xray.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/icons/zoom_ext.svg b/assets/icons/zoom_ext.svg new file mode 100644 index 000000000..6ad7b9021 --- /dev/null +++ b/assets/icons/zoom_ext.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/icons/zoom_in.svg b/assets/icons/zoom_in.svg new file mode 100644 index 000000000..2ea4594cc --- /dev/null +++ b/assets/icons/zoom_in.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/icons/zoom_out.svg b/assets/icons/zoom_out.svg new file mode 100644 index 000000000..1f235eddb --- /dev/null +++ b/assets/icons/zoom_out.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/app/commands.rs b/src/app/commands.rs index dc51e2840..b5d720431 100644 --- a/src/app/commands.rs +++ b/src/app/commands.rs @@ -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 — append a string xdata value for diff --git a/src/app/mod.rs b/src/app/mod.rs index db6f9e9cb..4ab55c042 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -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, /// 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, diff --git a/src/app/update.rs b/src/app/update.rs index ab0c49355..599ff8aca 100644 --- a/src/app/update.rs +++ b/src/app/update.rs @@ -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 { diff --git a/src/app/view.rs b/src/app/view.rs index 1bbd70582..9001af89d 100644 --- a/src/app/view.rs +++ b/src/app/view.rs @@ -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() diff --git a/src/modules/view/hidden.rs b/src/modules/view/hidden.rs index fc90a5eef..746f38830 100644 --- a/src/modules/view/hidden.rs +++ b/src/modules/view/hidden.rs @@ -1,9 +1,5 @@ use crate::modules::{IconKind, ModuleEvent, ToolDef}; +pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/hidden.svg")); pub fn tool() -> ToolDef { - ToolDef { - id: "HIDDENLINE", - label: "Hidden", - icon: IconKind::Glyph("◫"), - event: ModuleEvent::Command("HIDDENLINE".to_string()), - } + ToolDef { id: "HIDDENLINE", label: "Hidden", icon: ICON, event: ModuleEvent::Command("HIDDENLINE".to_string()) } } diff --git a/src/modules/view/orbit.rs b/src/modules/view/orbit.rs index 56ae434d3..c02335c7e 100644 --- a/src/modules/view/orbit.rs +++ b/src/modules/view/orbit.rs @@ -1,9 +1,5 @@ use crate::modules::{IconKind, ModuleEvent, ToolDef}; +pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/orbit.svg")); pub fn tool() -> ToolDef { - ToolDef { - id: "3DORBIT", - label: "3D Orbit", - icon: IconKind::Glyph("⟳"), - event: ModuleEvent::Command("3DORBIT".to_string()), - } + ToolDef { id: "3DORBIT", label: "3D Orbit", icon: ICON, event: ModuleEvent::Command("3DORBIT".to_string()) } } diff --git a/src/modules/view/ortho.rs b/src/modules/view/ortho.rs index eab2dbf07..9b32f778a 100644 --- a/src/modules/view/ortho.rs +++ b/src/modules/view/ortho.rs @@ -1,9 +1,5 @@ use crate::modules::{IconKind, ModuleEvent, ToolDef}; +pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/ortho.svg")); pub fn tool() -> ToolDef { - ToolDef { - id: "ORTHO", - label: "Ortho", - icon: IconKind::Glyph("⊡"), - event: ModuleEvent::Command("ORTHO".into()), - } + ToolDef { id: "ORTHO", label: "Ortho", icon: ICON, event: ModuleEvent::Command("ORTHO".into()) } } diff --git a/src/modules/view/pan.rs b/src/modules/view/pan.rs index b28bf8a2e..d54229bed 100644 --- a/src/modules/view/pan.rs +++ b/src/modules/view/pan.rs @@ -1,9 +1,5 @@ use crate::modules::{IconKind, ModuleEvent, ToolDef}; +pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/pan.svg")); pub fn tool() -> ToolDef { - ToolDef { - id: "PAN", - label: "Pan", - icon: IconKind::Glyph("✥"), - event: ModuleEvent::Command("PAN".to_string()), - } + ToolDef { id: "PAN", label: "Pan", icon: ICON, event: ModuleEvent::Command("PAN".to_string()) } } diff --git a/src/modules/view/persp.rs b/src/modules/view/persp.rs index 5aee81444..d4d71a9c3 100644 --- a/src/modules/view/persp.rs +++ b/src/modules/view/persp.rs @@ -1,9 +1,5 @@ use crate::modules::{IconKind, ModuleEvent, ToolDef}; +pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/persp.svg")); pub fn tool() -> ToolDef { - ToolDef { - id: "PERSP", - label: "Persp", - icon: IconKind::Glyph("⟁"), - event: ModuleEvent::Command("PERSP".into()), - } + ToolDef { id: "PERSP", label: "Persp", icon: ICON, event: ModuleEvent::Command("PERSP".into()) } } diff --git a/src/modules/view/solid.rs b/src/modules/view/solid.rs index 5f1206bf9..8aa9548e4 100644 --- a/src/modules/view/solid.rs +++ b/src/modules/view/solid.rs @@ -2,11 +2,7 @@ // id "SOLID" is special-cased in ribbon.rs for active-state highlighting. use crate::modules::{IconKind, ModuleEvent, ToolDef}; +pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/solid.svg")); pub fn tool() -> ToolDef { - ToolDef { - id: "SOLID", - label: "Solid", - icon: IconKind::Glyph("■"), - event: ModuleEvent::SetWireframe(false), - } + ToolDef { id: "SOLID", label: "Solid", icon: ICON, event: ModuleEvent::SetWireframe(false) } } diff --git a/src/modules/view/view_front.rs b/src/modules/view/view_front.rs index c2e228fea..5b304498b 100644 --- a/src/modules/view/view_front.rs +++ b/src/modules/view/view_front.rs @@ -1,9 +1,5 @@ use crate::modules::{IconKind, ModuleEvent, ToolDef}; +pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/view_front.svg")); pub fn tool() -> ToolDef { - ToolDef { - id: "VIEW_FRONT", - label: "Front", - icon: IconKind::Glyph("⊥"), - event: ModuleEvent::Command("VIEW FRONT".to_string()), - } + ToolDef { id: "VIEW_FRONT", label: "Front", icon: ICON, event: ModuleEvent::Command("VIEW FRONT".to_string()) } } diff --git a/src/modules/view/view_iso.rs b/src/modules/view/view_iso.rs index d9cacbfab..454b21140 100644 --- a/src/modules/view/view_iso.rs +++ b/src/modules/view/view_iso.rs @@ -1,9 +1,5 @@ use crate::modules::{IconKind, ModuleEvent, ToolDef}; +pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/view_iso.svg")); pub fn tool() -> ToolDef { - ToolDef { - id: "VIEW_ISO", - label: "Iso", - icon: IconKind::Glyph("◈"), - event: ModuleEvent::Command("VIEW ISO".to_string()), - } + ToolDef { id: "VIEW_ISO", label: "Iso", icon: ICON, event: ModuleEvent::Command("VIEW ISO".to_string()) } } diff --git a/src/modules/view/view_right.rs b/src/modules/view/view_right.rs index 806264a33..aaefe02c8 100644 --- a/src/modules/view/view_right.rs +++ b/src/modules/view/view_right.rs @@ -1,9 +1,5 @@ use crate::modules::{IconKind, ModuleEvent, ToolDef}; +pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/view_right.svg")); pub fn tool() -> ToolDef { - ToolDef { - id: "VIEW_RIGHT", - label: "Right", - icon: IconKind::Glyph("⊣"), - event: ModuleEvent::Command("VIEW RIGHT".to_string()), - } + ToolDef { id: "VIEW_RIGHT", label: "Right", icon: ICON, event: ModuleEvent::Command("VIEW RIGHT".to_string()) } } diff --git a/src/modules/view/view_top.rs b/src/modules/view/view_top.rs index 881f4e739..8f273b3fe 100644 --- a/src/modules/view/view_top.rs +++ b/src/modules/view/view_top.rs @@ -1,9 +1,5 @@ use crate::modules::{IconKind, ModuleEvent, ToolDef}; +pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/view_top.svg")); pub fn tool() -> ToolDef { - ToolDef { - id: "VIEW_TOP", - label: "Top", - icon: IconKind::Glyph("⊤"), - event: ModuleEvent::Command("VIEW TOP".to_string()), - } + ToolDef { id: "VIEW_TOP", label: "Top", icon: ICON, event: ModuleEvent::Command("VIEW TOP".to_string()) } } diff --git a/src/modules/view/wireframe.rs b/src/modules/view/wireframe.rs index 7064b652f..541ed1007 100644 --- a/src/modules/view/wireframe.rs +++ b/src/modules/view/wireframe.rs @@ -2,11 +2,7 @@ // id "WIREFRAME" is special-cased in ribbon.rs for active-state highlighting. use crate::modules::{IconKind, ModuleEvent, ToolDef}; +pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/wireframe.svg")); pub fn tool() -> ToolDef { - ToolDef { - id: "WIREFRAME", - label: "Wireframe", - icon: IconKind::Glyph("□"), - event: ModuleEvent::SetWireframe(true), - } + ToolDef { id: "WIREFRAME", label: "Wireframe", icon: ICON, event: ModuleEvent::SetWireframe(true) } } diff --git a/src/modules/view/xray.rs b/src/modules/view/xray.rs index ada75faf8..68d475a2e 100644 --- a/src/modules/view/xray.rs +++ b/src/modules/view/xray.rs @@ -1,9 +1,5 @@ use crate::modules::{IconKind, ModuleEvent, ToolDef}; +pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/xray.svg")); pub fn tool() -> ToolDef { - ToolDef { - id: "XRAY", - label: "X-Ray", - icon: IconKind::Glyph("◈"), - event: ModuleEvent::Command("XRAY".to_string()), - } + ToolDef { id: "XRAY", label: "X-Ray", icon: ICON, event: ModuleEvent::Command("XRAY".to_string()) } } diff --git a/src/modules/view/zoom_ext.rs b/src/modules/view/zoom_ext.rs index 814bcb9a5..7d93e2160 100644 --- a/src/modules/view/zoom_ext.rs +++ b/src/modules/view/zoom_ext.rs @@ -1,9 +1,5 @@ use crate::modules::{IconKind, ModuleEvent, ToolDef}; +pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/zoom_ext.svg")); pub fn tool() -> ToolDef { - ToolDef { - id: "ZOOM_EXT", - label: "Zoom Ext", - icon: IconKind::Glyph("⊡"), - event: ModuleEvent::Command("ZOOM EXTENTS".to_string()), - } + ToolDef { id: "ZOOM_EXT", label: "Zoom\nExtents", icon: ICON, event: ModuleEvent::Command("ZOOM EXTENTS".to_string()) } } diff --git a/src/modules/view/zoom_in.rs b/src/modules/view/zoom_in.rs index 0c13da651..a7ec941f7 100644 --- a/src/modules/view/zoom_in.rs +++ b/src/modules/view/zoom_in.rs @@ -1,9 +1,5 @@ use crate::modules::{IconKind, ModuleEvent, ToolDef}; +pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/zoom_in.svg")); pub fn tool() -> ToolDef { - ToolDef { - id: "ZOOM_IN", - label: "Zoom In", - icon: IconKind::Glyph("🔍"), - event: ModuleEvent::Command("ZOOM IN".to_string()), - } + ToolDef { id: "ZOOM_IN", label: "Zoom In", icon: ICON, event: ModuleEvent::Command("ZOOM IN".to_string()) } } diff --git a/src/modules/view/zoom_out.rs b/src/modules/view/zoom_out.rs index fef472e32..2eba9a8be 100644 --- a/src/modules/view/zoom_out.rs +++ b/src/modules/view/zoom_out.rs @@ -1,9 +1,5 @@ use crate::modules::{IconKind, ModuleEvent, ToolDef}; +pub const ICON: IconKind = IconKind::Svg(include_bytes!("../../../assets/icons/zoom_out.svg")); pub fn tool() -> ToolDef { - ToolDef { - id: "ZOOM_OUT", - label: "Zoom Out", - icon: IconKind::Glyph("🔎"), - event: ModuleEvent::Command("ZOOM OUT".to_string()), - } + ToolDef { id: "ZOOM_OUT", label: "Zoom Out", icon: ICON, event: ModuleEvent::Command("ZOOM OUT".to_string()) } } diff --git a/src/ui/statusbar.rs b/src/ui/statusbar.rs index 3568f72cd..d5b4aa177 100644 --- a/src/ui/statusbar.rs +++ b/src/ui/statusbar.rs @@ -40,6 +40,8 @@ impl StatusBar { viewport_count: usize, // True when the user is editing inside a paper-space viewport (MSPACE). in_mspace: bool, + // Whether the layout tabs (Model/Paper) are visible (LAYOUTTAB). + show_layout_tabs: bool, ) -> Element<'a, Message> { let menu_btn = button(text("≡").size(14).color(ICON_COLOR)) .on_press(Message::Command("MENU".into())) @@ -107,14 +109,16 @@ impl StatusBar { let mut bar = Row::new().align_y(iced::Center).spacing(0); bar = bar.push(menu_btn); - for name in layouts { - let is_active = name == current_layout; - let renaming = rename_state - .filter(|(orig, _)| *orig == name) - .map(|(_, edit)| edit.as_str()); - bar = bar.push(space_tab(name, is_active, renaming)); + if show_layout_tabs { + for name in layouts { + let is_active = name == current_layout; + let renaming = rename_state + .filter(|(orig, _)| *orig == name) + .map(|(_, edit)| edit.as_str()); + bar = bar.push(space_tab(name, is_active, renaming)); + } + bar = bar.push(add_btn); } - bar = bar.push(add_btn); bar = bar.push(iced::widget::Space::new().width(Length::Fill)); bar = bar.push(right_status);