On Tue, 4 Feb 2025 13:15:50 GMT, Prasanta Sadhukhan <psadhuk...@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.
>> 
>> ![radio-menuitem-with-icon-01-2025-02-04](https://github.com/user-attachments/assets/6a0dd6b6-c611-4fc7-9f25-5125c539fa5b)
>> 
>> ![radio-menuitem-with-icon-02-2025-02-04](https://github.com/user-attachments/assets/1e5a7540-d74e-4a5a-b338-2f04a5076c9d)
>> 
>> [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:  
>> ![Proposed layout - aligned 
>> text](https://github.com/user-attachments/assets/60ef0c8c-544c-44fd-8e7a-a0a52254f9b6)
>>   
>> 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:  
>> ![Proposed layout - unaligned 
>> text](https://github.com/user-attachments/assets/7ee4a124-ed16-4606-b325-d9dafc96d4d8)
>>   
>> where the second menu item remains at the position where it's rendered now.
>
> I have modified the PR to move the icon w.r.t bullet skin width and it looks 
> like this in windows 11..I believe this should work for windows 10 also but I 
> dont have windows10 to check
> 
> ![image](https://github.com/user-attachments/assets/953eee76-ee88-4189-9ed8-681854c27363)
> 
> 
> I dont think we can tamper with text location as it is done in 
> WindowsMenuItemUI#paintText which does not have any knowledge of bullet/icon 
> presence.
> Also, ideally I dont think this should be applicable for windows10 and we 
> should do this only for windows11 but I am not sure if there is version check 
> in our code and anyway, windows10 would be EOL-ed and unsupported platform in 
> few months

It looks ok in windows 11 with both icon selected/unselected

![image](https://github.com/user-attachments/assets/34fd2ba2-40c7-47f5-a241-6f16a90d3b26)

![image](https://github.com/user-attachments/assets/0d175b8f-f2f8-489b-a6e9-2aa9f17d1a70)

I would like to know how it looks in windows 10? Is there any issue?

Although, as per https://bugs.openjdk.org/browse/JDK-8349268 windows 10 is not 
supported in JDK25 and this fix is going in mainline jdk25

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/23324#discussion_r1942995657

Reply via email to