-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MouseArea
widget
#1594
MouseArea
widget
#1594
Conversation
120c7eb
to
06611ce
Compare
Hi! Just a heads up that with the current implementation it looks like Screen.Recording.2023-01-08.at.8.56.05.PM.mov(Thank you @13r0ck for pointing out this scenario over on Discord for my mouse_area prototype, which also suffers from this problem). |
native/src/widget/mouse_listener.rs
Outdated
} | ||
} | ||
|
||
if let Some(message) = widget.on_right_press.clone() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! You could clone the message only if its published.
These should be ignored generally, since they are considered passive user actions.
The event that triggers a mouse enter could be a mouse button press/release.
These need continuity guarantees (e.g. mandatory widget id), which we don't have yet!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks and sorry for the wait! 🙇
I had to unfortunately remove the on_mouse_enter
and on_mouse_exit
events since, as others pointed out in the comments, in order to support them we would need some kind of continuity guarantees in the persistent widget tree that we currently lack. Certainly something we should revisit in the future!
In any case, I think we can merge this simplified version 🚢
Implements iced-rs/rfcs#12
Run example with
cargo run --release -p headerbar
Not a breaking change