fix(grip): open hover popup without requiring mouse motion
Dwell timing only advanced when `ViewportMove` fired; a perfectly still cursor never triggered the popup. Subscribe to animation frames while `grip_hover` is set and dispatch `GripDwellTick` from them so `update_grip_hover` re-checks the elapsed dwell each frame. Subscription auto-stops as soon as the hover clears or the popup opens.
This commit is contained in:
parent
6c1462932d
commit
595ee3e245
3 changed files with 29 additions and 0 deletions
|
|
@ -932,9 +932,20 @@ impl OpenCADStudio {
|
|||
} else {
|
||||
Subscription::none()
|
||||
};
|
||||
// While the cursor sits over a grip, request animation frames
|
||||
// so the multi-functional popup opens even when the user keeps
|
||||
// the mouse perfectly still — `ViewportMove` alone would never
|
||||
// fire again. Auto-stops once the hover clears or the popup is
|
||||
// already open.
|
||||
let grip_dwell = if self.grip_hover.is_some() && self.grip_popup.is_none() {
|
||||
window::frames().map(|_| Message::GripDwellTick)
|
||||
} else {
|
||||
Subscription::none()
|
||||
};
|
||||
iced::Subscription::batch([
|
||||
frames,
|
||||
history_tick,
|
||||
grip_dwell,
|
||||
event::listen_with(|ev, status, win_id| {
|
||||
use iced::event::Status;
|
||||
match ev {
|
||||
|
|
|
|||
Loading…
Reference in a new issue