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:
Matus Mastena committed 2026-09-17 16:54:11 +02:00
1 parent 1aa299e204
commit d1c3106283
6 files changed
+232 -2

No files matched your search

+11 -2
View File
@@ -42,6 +42,8 @@ pub enum PanelId {
Properties,
BlockPalette,
ExternalReferences,
/// Outline of the drawing's origin planes, open sketch and solid bodies.
Browser,
}
impl PanelId {
@@ -51,6 +53,7 @@ impl PanelId {
PanelId::Properties => "Properties",
PanelId::BlockPalette => "Block Palette",
PanelId::ExternalReferences => "External References",
PanelId::Browser => "Browser",
}
}
@@ -60,6 +63,7 @@ impl PanelId {
PanelId::Properties => 250.0,
PanelId::BlockPalette => 260.0,
PanelId::ExternalReferences => 460.0,
PanelId::Browser => 230.0,
}
}
@@ -117,7 +121,7 @@ impl Default for DockState {
fn default() -> Self {
Self {
left: vec![PanelId::Properties],
right: vec![PanelId::BlockPalette],
right: vec![PanelId::Browser, PanelId::BlockPalette],
panels: BTreeMap::new(),
}
}
@@ -143,7 +147,12 @@ impl DockState {
/// resize never hit a missing configuration. Also a cheap heal for configs
/// written by an older version.
pub fn ensure_settings(&mut self) {
for id in [PanelId::Properties, PanelId::BlockPalette, PanelId::ExternalReferences] {
for id in [
PanelId::Properties,
PanelId::BlockPalette,
PanelId::ExternalReferences,
PanelId::Browser,
] {
self.panels.entry(id).or_insert_with(|| DockPanel::for_id(id));
}
}