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

Windows 11: Rounded popup windows #643

Merged
merged 2 commits into from
Feb 5, 2023
Merged

Windows 11: Rounded popup windows #643

merged 2 commits into from
Feb 5, 2023

Conversation

DevCharly
Copy link
Collaborator

@DevCharly DevCharly commented Jan 27, 2023

This PR enables native Windows 11 rounded borders (including drop shadow) for popups.

PopupMenu:

grafik

ComboBox:

grafik

ToolTip:

grafik

macOS theme (running on Windows 11) using larger corner radius for popup menus:

grafik

The rounded popup borders are enabled by default for all themes.

There are 4 UI properties for configuration:

PopupMenu.borderCornerRadius
ComboBox.borderCornerRadius
ToolTip.borderCornerRadius
Popup.borderCornerRadius

The first three are used for JPopupMenu, JComboBox and JToolTip.
The last one is used for other components shown as popup via PopupFactory.getPopup().

There is also a client property Popup.borderCornerRadius that allows changing corner radius for specific popups.

Note that Windows 11 supports only two different corner radiuses.
The smaller one is about 4px and the larger 8px.

@DevCharly DevCharly added this to the 3.1 milestone Jan 27, 2023
@DevCharly DevCharly merged commit 136e1e4 into main Feb 5, 2023
DevCharly added a commit that referenced this pull request Feb 5, 2023
built by GitHub Actions:
https://github.com/JFormDesigner/FlatLaf/actions/runs/4097364667

locally signed Windows DLLs with FormDev Software GmbH code signing certificate
@DevCharly DevCharly deleted the rounded-popup-windows branch February 5, 2023 16:34
DevCharly added a commit that referenced this pull request Feb 10, 2023
…WindowsLibrary.getOSBuildNumberImpl()` (regression in PR #643, commit 07ad467)

added additional platform checks to `FlatNative<platform>Library.isLoaded()` methods
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.

None yet

1 participant