fix(dock): keep auto-hiding panels shown while the pointer is on their dropdowns

iced gives the layer under an overlay a levitating cursor, so the dock
edge's mouse_area read the pointer on any dropdown or combo list in a
pallet as leaving, and auto-hide collapsed the panel mid-pick. Track
enter/leave with a small hover_zone wrapper that lands the cursor before
its bounds test, on docked edges and floating pallets alike.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014ihuqzxdUhd9UbioPn5MGu
This commit is contained in:
Claude committed 2026-10-15 18:30:37 +00:00
1 parent 33433b8924
commit c74dca4f32
4 files changed
+196 -15

No files matched your search

+6 -6
View File
@@ -207,12 +207,12 @@ impl OpenCADStudio {
Some(HoverPending::Hide)
if self.dock_peek.is_some_and(|id| self.dock.auto_hides(id)) =>
{
// A dropdown or the colour window opened from the
// panel draws as an overlay, which the edge's
// mouse area reads as the pointer leaving. Keep
// the panel out until it closes, so a pick can
// still land; then hide unless the pointer is
// back (its re-entry cancels this).
// The edge's hover zone keeps a dropdown inside
// it from reading as a leave; a colour popup can
// still reach past it (or be the Select Color
// window). Keep the panel out until it closes, so
// a pick can still land; then hide unless the
// pointer is back (its re-entry cancels this).
if self.dock_popup_open() {
return self.dock_hover_arm(HoverPending::Hide);
}
+14 -9
View File
@@ -164,12 +164,13 @@ impl OpenCADStudio {
children.push(strip);
}
}
Some(
mouse_area(row(children).height(Fill))
.on_enter(Message::Dock(crate::ui::dock::DockMsg::HoverStay))
.on_exit(Message::Dock(crate::ui::dock::DockMsg::HoverExit))
.into(),
)
// Not a `mouse_area`: the pointer on one of the pallet's own
// dropdowns must not read as leaving the edge.
Some(crate::ui::hover_zone::hover_zone(
row(children).height(Fill),
Message::Dock(crate::ui::dock::DockMsg::HoverStay),
Message::Dock(crate::ui::dock::DockMsg::HoverExit),
))
}
/// An edge's vertical icon strip: per group its open pallets' icons in a
@@ -555,10 +556,14 @@ impl OpenCADStudio {
// on its empty areas don't fall through to the drawing below.
let panel = mouse_area(framed)
.on_press(Message::Dock(DockMsg::FloatRaise(f.id)))
.on_enter(Message::Dock(DockMsg::Hover(f.id)))
.on_exit(Message::Dock(DockMsg::HoverExit))
.interaction(iced::mouse::Interaction::Idle);
place_at(panel.into(), x, y)
// Enter / leave as on a docked edge: its dropdowns keep it shown.
let panel = crate::ui::hover_zone::hover_zone(
panel,
Message::Dock(DockMsg::Hover(f.id)),
Message::Dock(DockMsg::HoverExit),
);
place_at(panel, x, y)
}
/// Where floating panel `f` draws.