forked from 1b-agent/opencadstudio-upstream
Merge pull request #1702 from MarcelP102/Pallet-placement
[UX] Pallets you can dock, group and float (including LAYERS panel)
This commit is contained in:
commit
7ca457a6cc
54 files changed
+4245
-1098
No files matched your search
@@ -929,18 +929,7 @@ impl OpenCADStudio {
|
||||
if self.show_external_references {
|
||||
// Always open expanded so the panel is immediately usable;
|
||||
// dock it on the right if the user closed it from the layout.
|
||||
if self
|
||||
.dock
|
||||
.location(crate::ui::dock::PanelId::ExternalReferences)
|
||||
.is_none()
|
||||
{
|
||||
self.dock.dock(
|
||||
crate::ui::dock::PanelId::ExternalReferences,
|
||||
crate::app::config::DockSide::Right,
|
||||
usize::MAX,
|
||||
);
|
||||
}
|
||||
self.dock_expanded = Some(crate::ui::dock::PanelId::ExternalReferences);
|
||||
self.dock_open_at_default(crate::ui::dock::PanelId::ExternalReferences);
|
||||
self.refresh_xref_manager();
|
||||
}
|
||||
}
|
||||
@@ -1784,7 +1773,7 @@ mod tests {
|
||||
let _ = app.run_command_line("BLOCKPALETTE");
|
||||
assert!(app.show_block_palette);
|
||||
assert!(
|
||||
app.dock_expanded == Some(crate::ui::dock::PanelId::BlockPalette),
|
||||
app.dock_peek == Some(crate::ui::dock::PanelId::BlockPalette),
|
||||
"palette must open expanded, not as the collapsed bar"
|
||||
);
|
||||
// BLOCKSPALETTE only opens; BLOCKSPALETTECLOSE closes.
|
||||
|
||||
@@ -259,13 +259,9 @@ impl OpenCADStudio {
|
||||
self.count_palette.show = open;
|
||||
self.ribbon.set_count_palette(open);
|
||||
if open {
|
||||
if self.dock.location(id).is_none() {
|
||||
self.dock
|
||||
.dock(id, crate::app::config::DockSide::Right, usize::MAX);
|
||||
}
|
||||
self.dock_expanded = Some(id);
|
||||
} else if self.dock_expanded == Some(id) {
|
||||
self.dock_expanded = None;
|
||||
self.dock_open_at_default(id);
|
||||
} else {
|
||||
self.dock_unpeek(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -384,7 +384,9 @@ impl OpenCADStudio {
|
||||
"ORTHO" => return Some(Task::done(Message::ToggleOrtho)),
|
||||
"PARALLEL" => return Some(Task::done(Message::SetProjection(true))),
|
||||
"PERSP" => return Some(Task::done(Message::SetProjection(false))),
|
||||
"LAYERS" => return Some(Task::done(Message::ToggleLayers)),
|
||||
// LAYERS opens the Layer Manager pallet (its close button or
|
||||
// the toggle message close it).
|
||||
"LAYERS" => self.open_layers_pallet(),
|
||||
|
||||
// SCRIPT <path> — run a command script: each non-comment
|
||||
// line is fed through the same command path the `--script` startup
|
||||
|
||||
@@ -704,15 +704,7 @@ impl OpenCADStudio {
|
||||
// rearrange themselves on upgrade for a panel they have
|
||||
// not asked for.
|
||||
let id = crate::ui::dock::PanelId::Browser;
|
||||
if self.dock.location(id).is_none() {
|
||||
// dock() clamps an out-of-range index to the end of
|
||||
// the edge, so this appends below whatever is there.
|
||||
self.dock
|
||||
.dock(id, crate::app::config::DockSide::Right, usize::MAX);
|
||||
}
|
||||
// Open expanded so it is usable straight away; the pin
|
||||
// button still collapses it.
|
||||
self.dock_expanded = Some(id);
|
||||
self.dock_open_at_default(id);
|
||||
self.command_line
|
||||
.push_output(crate::t!("Browser opened.").as_ref());
|
||||
} else {
|
||||
|
||||
@@ -444,17 +444,11 @@ impl OpenCADStudio {
|
||||
"POINTCLOUDMANAGER" => {
|
||||
let id = crate::ui::dock::PanelId::PointCloudManager;
|
||||
self.pc_manager.show = true;
|
||||
if self.dock.location(id).is_none() {
|
||||
self.dock
|
||||
.dock(id, crate::app::config::DockSide::Right, usize::MAX);
|
||||
}
|
||||
self.dock_expanded = Some(id);
|
||||
self.dock_open_at_default(id);
|
||||
}
|
||||
"POINTCLOUDMANAGERCLOSE" => {
|
||||
self.pc_manager.show = false;
|
||||
if self.dock_expanded == Some(crate::ui::dock::PanelId::PointCloudManager) {
|
||||
self.dock_expanded = None;
|
||||
}
|
||||
self.dock_unpeek(crate::ui::dock::PanelId::PointCloudManager);
|
||||
}
|
||||
"_PCUNCROP" => self
|
||||
.edit_selected_point_clouds(i, "POINTCLOUDUNCROP", |data| data.croppings.clear()),
|
||||
|
||||
@@ -660,13 +660,9 @@ impl OpenCADStudio {
|
||||
self.sheet_set.show = on;
|
||||
self.ribbon.set_sheet_set(on);
|
||||
if on {
|
||||
if self.dock.location(id).is_none() {
|
||||
self.dock
|
||||
.dock(id, crate::app::config::DockSide::Right, usize::MAX);
|
||||
}
|
||||
self.dock_expanded = Some(id);
|
||||
} else if self.dock_expanded == Some(id) {
|
||||
self.dock_expanded = None;
|
||||
self.dock_open_at_default(id);
|
||||
} else {
|
||||
self.dock_unpeek(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user