Use consistent dialog button order on MacOS#8316
Merged
eirikbakke merged 1 commit intoapache:masterfrom Mar 12, 2025
Merged
Conversation
Member
neilcsmith-net
left a comment
There was a problem hiding this comment.
Thanks for looking at this! Generally looks a good change. I retain reservations as always at adding LaF ID checks. It reverses the correct logic.
afb72b5 to
6937644
Compare
Contributor
Author
|
Force-pushed to use UIManager.getBoolean("OptionPane.isYesLast") instead of checking for FlatLAF as suggested by @neilcsmith-net. |
mbien
reviewed
Mar 12, 2025
This used to be the standard behavior when the Aqua LAF was the default, but stopped working once we switched to FlatLAF as the default LAF. (For example, MacOS HID guidelines require the default button to always be to the right, and that the Cancel button always be to the left.)
6937644 to
6c1ea0b
Compare
neilcsmith-net
approved these changes
Mar 12, 2025
Member
neilcsmith-net
left a comment
There was a problem hiding this comment.
Principal and code diff looks good to me. Not checked for functionality on a mac as of yet!
mbien
approved these changes
Mar 12, 2025
Contributor
Author
|
Thanks for reviewing! I tested the latest version again on Windows and MacOS, confirming the different button orders. The two dialogs I looked at was the "Find in Projects" one as seen in the screenshots, and the "Options" dialog. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On MacOS, use the idiomatic button order for dialog boxes. For example, MacOS HID guidelines require the default button to always be to the right, and that the Cancel button always be to the left.
This used to be the standard behavior when the Aqua LAF was the default, but stopped working once we switched to FlatLAF as the default LAF. It is also the standard in dialog boxes created via JOptionPane instead of DialogDisplayer, so NetBeans currently has a mix of button orders, which is fixed by this patch.
Example before:

Example after:
