forked from 1b-agent/opencadstudio-upstream
Add the Browser panel
A docked outline of the drawing: the three origin planes, the open sketch, and every solid labelled with the operation that made it, recovered through primitive_property_operation. Rows run ordinary commands, so clicking a plane starts a sketch on it and clicking a body selects it. It is a table of contents, not a feature tree. The DWG history records how each solid was built but nothing re-runs it, so an earlier feature cannot be edited to rebuild the ones after it. Presenting the list as editable history would promise exactly that, so the panel states what it is instead. Off by default and opened with BROWSER, leaving the existing dock layout alone for anyone who does not want it.
This commit is contained in:
6 files changed
+232
-2
No files matched your search
@@ -733,6 +733,9 @@ pub(super) struct OpenCADStudio {
|
||||
pub(crate) show_block_palette: bool,
|
||||
/// Docked External References panel visibility (EXTERNALREFERENCES).
|
||||
pub(crate) show_external_references: bool,
|
||||
/// Whether the Browser panel is shown. Off until BROWSER opens it, so
|
||||
/// the default layout is unchanged for existing users.
|
||||
pub(crate) show_browser: bool,
|
||||
/// General edge-stack dock layout for the side panels.
|
||||
pub(crate) dock: crate::ui::dock::DockState,
|
||||
/// Which panel is currently floated at full height (hovered, or a pinned
|
||||
@@ -3929,6 +3932,7 @@ impl OpenCADStudio {
|
||||
show_properties: true,
|
||||
show_block_palette: false,
|
||||
show_external_references: false,
|
||||
show_browser: false,
|
||||
block_palette: Default::default(),
|
||||
xref_manager: Default::default(),
|
||||
dock: Default::default(),
|
||||
|
||||
@@ -602,6 +602,9 @@ pub(super) fn on_ribbon_tool_click(&mut self, tool_id: String, event: ModuleEven
|
||||
PanelId::ExternalReferences => {
|
||||
self.show_external_references = false;
|
||||
}
|
||||
PanelId::Browser => {
|
||||
self.show_browser = false;
|
||||
}
|
||||
PanelId::Properties => {
|
||||
self.show_properties = false;
|
||||
self.ribbon.set_properties(false);
|
||||
@@ -704,6 +707,7 @@ pub(super) fn on_ribbon_tool_click(&mut self, tool_id: String, event: ModuleEven
|
||||
PanelId::Properties => self.show_properties,
|
||||
PanelId::BlockPalette => self.show_block_palette,
|
||||
PanelId::ExternalReferences => self.show_external_references,
|
||||
PanelId::Browser => self.show_browser,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1820,6 +1820,7 @@ bg={bg_ms:.1}ms n={view_count}"
|
||||
crate::ui::dock::PanelId::Properties => self.show_properties,
|
||||
crate::ui::dock::PanelId::BlockPalette => self.show_block_palette,
|
||||
crate::ui::dock::PanelId::ExternalReferences => self.show_external_references,
|
||||
crate::ui::dock::PanelId::Browser => self.show_browser,
|
||||
}
|
||||
};
|
||||
let edge_stack = |side: crate::app::config::DockSide| -> Option<Element<'_, Message>> {
|
||||
@@ -2881,6 +2882,12 @@ impl OpenCADStudio {
|
||||
tab.xref_missing,
|
||||
&tab.scene.document,
|
||||
),
|
||||
crate::ui::dock::PanelId::Browser => crate::ui::window::browser::view(
|
||||
&tab.scene.document,
|
||||
tab.sketch_session.as_ref().map(|session| session.name.as_str()),
|
||||
width,
|
||||
auto_collapse,
|
||||
),
|
||||
};
|
||||
let divider = dock_divider(id);
|
||||
match side {
|
||||
|
||||
Reference in new issue
Block a user