RFR: 8348760: RadioButton is not shown if JRadioButtonMenuItem is rendered with ImageIcon in WindowsLookAndFeel [v6]
Alexey Ivanov
aivanov at openjdk.org
Tue Feb 4 12:27:17 UTC 2025
On Tue, 4 Feb 2025 11:39:48 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
> But that's what I believe is been done now in the PR test, corresponding to your 1st image and corresponds to windows11
No, it doesn't.
On Windows 10 which has a selected background around the bullet, it looks completely off.


[The original behaviour](https://github.com/openjdk/jdk/pull/23324#issuecomment-2624726843) was consistent at least.
Yet what the currently proposed fix produces doesn't look right at all.
The bullet or check-mark should remain centered in their own place as if there's no icon.
> Are you suggesting to keep more gap in between checkmark and button?
Yes, but not only.
If there's an icon, it should move the text to the right to accommodate the additional icon, if we're going this route.
In addition to that, the text in all other menu items should move to the right for consistency so that all the menu items are aligned and items without an icon render an empty icon in this case.
We may introduce a property that controls this behaviour: whether the text aligns in all the menu items or not.
The first option corresponds to this layout:

where all the text moves right to add space for menu icons. This corresponds to menu layout in File Explorer in Windows 11.
The second option corresponds to this layout:

where the second menu item remains at the position where it's rendered now.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23324#discussion_r1941070014
More information about the client-libs-dev
mailing list