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

Disabled items in multiselection RoundedToolbar generate SelectionEvents #73

Closed
swtdev opened this issue Jan 8, 2018 · 1 comment
Closed

Comments

@swtdev
Copy link
Contributor

swtdev commented Jan 8, 2018

Hi Laurent,

We have an issue with disabled items in RoundedToolbars unexpectedly generating SelectionEvents. Seems to us that it doesn't make sense for them to do so, no? A disabled item shouldn't generated these when clicked, surely?

You can disable the RoundedToolbar and no SelectionEvents are generated at all. Looks like calling setEnabled on RoundedToolItem only affects the image displayed.

Fix seems simple, RoundedToolbar:136:
if (item.getBounds().contains(event.x, event.y)) {
change to:
if (item.getBounds().contains(event.x, event.y) && item.isEnabled()) {

Could also move the check inside the if() instead and have it escape the for() loop, as an optimisation.

Thanks,
Justin

swtdev added a commit to swtdev/opal that referenced this issue Jan 24, 2018
@lcaron
Copy link
Owner

lcaron commented Feb 10, 2018

Fixed on release 1.0.9, thank you Justin 👍

@lcaron lcaron closed this as completed Feb 10, 2018
lcaron pushed a commit that referenced this issue Feb 10, 2018
lcaron pushed a commit that referenced this issue Feb 10, 2018
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

2 participants