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

Check widget: Only respond to hover and tap over the checkbox or label #4526

Merged
merged 3 commits into from
Jan 8, 2024

Conversation

dweymouth
Copy link
Contributor

@dweymouth dweymouth commented Jan 7, 2024

Description:

Fixes #4527, related to #4320

Updates the Check widget to only respond to hover and tap events over either the checkbox or the label area of the widget. If the widget is wider or taller because it is placed in a container that maximizes its size, ignore events outside the "active" area of the widget.

The first commit of this PR just reordered the functions in check.go in a way that made more sense (resulting in an inflated line count diff relative to the actual code change). To review, you may wish to only look at the second commit.

Note: the behavior can be tested with fyne_demo. Before this change the check widget could be toggled by tapping far to the right, well beyond the end of the label. With the behavior, tapping/hovering in that area of the widget (which intuitively to the user is not part of the widget at all) does nothing

Checklist:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.

@coveralls
Copy link

coveralls commented Jan 7, 2024

Coverage Status

coverage: 64.684% (+0.1%) from 64.55%
when pulling c630423 on dweymouth:check-tappable-area
into 8458aff on fyne-io:develop.

@dweymouth dweymouth marked this pull request as ready for review January 7, 2024 17:24
@Jacalz
Copy link
Member

Jacalz commented Jan 7, 2024

Did you mean to request a review? :)

@dweymouth
Copy link
Contributor Author

Yes, this pr is ready for review :)

@Jacalz
Copy link
Member

Jacalz commented Jan 7, 2024

I mean given that you assigned me and Andrew to it? ;)

@dweymouth
Copy link
Contributor Author

Just wasn't sure how you had notifications setup

@Jacalz
Copy link
Member

Jacalz commented Jan 8, 2024

Alright, cool. Absolutely no problem. Just though you might have wanted us to do something else than review :)

Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Really nice change. More consistency with the Radio widget 👍
Just left one minor suggestion inline

widget/check.go Outdated Show resolved Hide resolved
@dweymouth dweymouth added this to the v2.4.4 milestone Jan 8, 2024
Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonderful work. Thanks :)

@dweymouth dweymouth merged commit 057726e into fyne-io:develop Jan 8, 2024
12 checks passed
@dweymouth dweymouth deleted the check-tappable-area branch January 8, 2024 21:58
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

Successfully merging this pull request may close these issues.

Check widget: hovering/tapping to the right of the label area should not activate widget
4 participants