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

Bug: disabled SpToolbarButtonPresenter instances respond to mouse events #1560

Open
koendehondt opened this issue Jun 18, 2024 · 2 comments
Open

Comments

@koendehondt
Copy link
Contributor

When #1559 is fixed, we have another issue.

presenter := SpPresenter new.
button := SpButtonPresenter new
	icon: (presenter iconNamed: #smallSave);
	enabled: [ false ];
	action: [ button inspect ];
	yourself.
presenter layout: (SpBoxLayout newLeftToRight
	add: button;
	yourself).
presenter open

makes the simple button unresponsive to mouse events, which is as expected.

But

presenter := SpPresenter new.
button := SpToolbarButtonPresenter new
	icon: (presenter iconNamed: #smallSave);
	enabled: [ false ];
	action: [ button inspect ];
	yourself.
presenter layout: (SpBoxLayout newLeftToRight
	add: button;
	yourself).
presenter open

makes the toolbar button responsive to mouse events, which is not expected. The button is highlighted when hovering over it. Clicking the button triggers the action.

The example above may be a bit strange because the toolbar button is used outside a toolbar, but the bug is present too when the toolbar button is part of a toolbar, as shown below when the mouse pointer is hovering over the Save button. The button is disabled (after applying the fix required for #1559).

Screenshot 2024-06-18 at 23 02 53

Please note that this bug is annoying when readers of the Spec book try the code examples. However, the issue is not blocking. That said, it would still be good to fix it so we do not get questions from readers. cc @Ducasse.

@koendehondt
Copy link
Contributor Author

Fixing it for the Spec book means fixing it in Pharo 12.

@Ducasse
Copy link
Contributor

Ducasse commented Jun 19, 2024

In fact the label in the Spec project is better than in the book repo. :)
@estebanlm

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

No branches or pull requests

2 participants