Skip to content

Use consistent dialog button order on MacOS#8316

Merged
eirikbakke merged 1 commit intoapache:masterfrom
eirikbakke:pr-dialogbuttons
Mar 12, 2025
Merged

Use consistent dialog button order on MacOS#8316
eirikbakke merged 1 commit intoapache:masterfrom
eirikbakke:pr-dialogbuttons

Conversation

@eirikbakke
Copy link
Copy Markdown
Contributor

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:
image

Example after:
image

@eirikbakke eirikbakke added Platform [ci] enable platform tests (platform/*) UI User Interface labels Mar 11, 2025
Copy link
Copy Markdown
Member

@neilcsmith-net neilcsmith-net left a comment

Choose a reason for hiding this comment

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

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.

Comment thread platform/core.windows/src/org/netbeans/core/windows/services/NbPresenter.java Outdated
@eirikbakke
Copy link
Copy Markdown
Contributor Author

Force-pushed to use UIManager.getBoolean("OptionPane.isYesLast") instead of checking for FlatLAF as suggested by @neilcsmith-net.

@mbien mbien added the os:macos label Mar 12, 2025
Comment thread platform/core.windows/src/org/netbeans/core/windows/services/NbPresenter.java Outdated
Comment thread platform/core.windows/src/org/netbeans/core/windows/services/NbPresenter.java Outdated
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.)
@mbien mbien added this to the NB26 milestone Mar 12, 2025
Copy link
Copy Markdown
Member

@neilcsmith-net neilcsmith-net left a comment

Choose a reason for hiding this comment

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

Principal and code diff looks good to me. Not checked for functionality on a mac as of yet!

@eirikbakke
Copy link
Copy Markdown
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.

@eirikbakke eirikbakke merged commit f0d377a into apache:master Mar 12, 2025
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

os:macos Platform [ci] enable platform tests (platform/*) UI User Interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants