forked from 1b-agent/opencadstudio-upstream
Dock: review fixes - hover, preview width, stale indexes, config healing
Fixes: - Hover state no longer drops when the pointer moves up from one strip icon, group grip or title bar to the one above: iced handles the element above first, so the old element's "left" (None) cleared the hover just set. Leave messages now carry the element and only clear their own hover. - The drop preview used the pallets' own widths; it now uses the group's width, matching where the pallet lands. - Group indexes from messages (group grab, splitter) are looked up safely, so a message from before a layout change no longer panics. - Floating placements read from the config are healed (finite, positive, at least the minimum size), like the group weights already were. - The shown group's edge bar is centred in its row: a stack takes its height from its first layer, and the icon column was shorter than the row. The "Drag to move group" tooltip is removed. Simplifications (no behaviour change): - dock_open_at_default / dock_unpeek replace seven copies of "dock on the right if unplaced, then reveal" and four of "stop peeking". - The drop target takes the grab offset as a parameter, so a drag update stores its state once. - dock_set_open, ensure_settings, the shown-index bookkeeping after a group is removed and the on-screen width clamp each lose duplication. - VBarLabel drops options its single caller never varied. - The drop preview's landing computation is one helper. Naming and consistency: pallet names in the + menu, the drag ghost and the floating title bar go through t!(); StripHit::Tab becomes StripHit::Join; stale comments updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013RyGiMXcsf9HTKfqDxaQGt
This commit is contained in:
11 files changed
+239
-258
No files matched your search
@@ -911,17 +911,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
|
||||
.is_placed(crate::ui::dock::PanelId::ExternalReferences)
|
||||
{
|
||||
self.dock.dock(
|
||||
crate::ui::dock::PanelId::ExternalReferences,
|
||||
crate::app::config::DockSide::Right,
|
||||
usize::MAX,
|
||||
);
|
||||
}
|
||||
self.dock_reveal(crate::ui::dock::PanelId::ExternalReferences);
|
||||
self.dock_open_at_default(crate::ui::dock::PanelId::ExternalReferences);
|
||||
self.refresh_xref_manager();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -236,12 +236,9 @@ impl OpenCADStudio {
|
||||
self.count_palette.show = open;
|
||||
self.ribbon.set_count_palette(open);
|
||||
if open {
|
||||
if !self.dock.is_placed(id) {
|
||||
self.dock.dock(id, crate::app::config::DockSide::Right, usize::MAX);
|
||||
}
|
||||
self.dock_reveal(id);
|
||||
} else if self.dock_peek == Some(id) {
|
||||
self.dock_peek = None;
|
||||
self.dock_open_at_default(id);
|
||||
} else {
|
||||
self.dock_unpeek(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -679,15 +679,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.is_placed(id) {
|
||||
// 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_reveal(id);
|
||||
self.dock_open_at_default(id);
|
||||
self.command_line
|
||||
.push_output(crate::t!("Browser opened.").as_ref());
|
||||
} else {
|
||||
|
||||
@@ -374,16 +374,11 @@ impl OpenCADStudio {
|
||||
"POINTCLOUDMANAGER" => {
|
||||
let id = crate::ui::dock::PanelId::PointCloudManager;
|
||||
self.pc_manager.show = true;
|
||||
if !self.dock.is_placed(id) {
|
||||
self.dock.dock(id, crate::app::config::DockSide::Right, usize::MAX);
|
||||
}
|
||||
self.dock_reveal(id);
|
||||
self.dock_open_at_default(id);
|
||||
}
|
||||
"POINTCLOUDMANAGERCLOSE" => {
|
||||
self.pc_manager.show = false;
|
||||
if self.dock_peek == Some(crate::ui::dock::PanelId::PointCloudManager) {
|
||||
self.dock_peek = None;
|
||||
}
|
||||
self.dock_unpeek(crate::ui::dock::PanelId::PointCloudManager);
|
||||
}
|
||||
"_PCUNCROP" =>self.edit_selected_point_clouds(i, "POINTCLOUDUNCROP", |data| data.croppings.clear()),
|
||||
"_PDFULUNCLIP" => {
|
||||
|
||||
@@ -577,12 +577,9 @@ impl OpenCADStudio {
|
||||
self.sheet_set.show = on;
|
||||
self.ribbon.set_sheet_set(on);
|
||||
if on {
|
||||
if !self.dock.is_placed(id) {
|
||||
self.dock.dock(id, crate::app::config::DockSide::Right, usize::MAX);
|
||||
}
|
||||
self.dock_reveal(id);
|
||||
} else if self.dock_peek == Some(id) {
|
||||
self.dock_peek = None;
|
||||
self.dock_open_at_default(id);
|
||||
} else {
|
||||
self.dock_unpeek(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user