Skip to content
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

Overriding singleFindByPoint does not affect hover style behavior #319

Open
julmb opened this issue May 13, 2024 · 0 comments
Open

Overriding singleFindByPoint does not affect hover style behavior #319

julmb opened this issue May 13, 2024 · 0 comments

Comments

@julmb
Copy link

julmb commented May 13, 2024

I want to make a button widget with a custom hitbox. This hitbox should be used for both click and hover events (including styleHover). My approach so far is to define a custom widget using createSingle.

From the documentation, it sounds like Single.singleFindByPoint would allow me to achieve my goal. It seems that this affects which SystemEvent.Click events reach the widget (and maybe SystemEvent.Enter, but I have not tested this). However, it does not seem to affect when the styleHover style is applied. Indeed, setting singleFindByPoint to a function that always returns Nothing still applies hover style changes when the mouse is moved across the widget.

I am not sure if this is a bug or intended behavior. In either case, it would be very useful if singleFindByPoint would take care of both the SystemEvents, aswell as the styleHover behavior.

As an aside, the documentation at https://hackage.haskell.org/package/monomer-1.6.0.1/docs/Monomer-Widgets-Single.html#t:SingleFindByPointHandler mentions that Monomer.Widgets.Singles.Radio is an example using this override. However, this seems to not be the case. Instead, Radio seems to override singleGetCurrentStyle to achieve the desired style changes with elliptical hit detection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant