On Wed, 5 Feb 2025 02:33:04 GMT, Prasanta Sadhukhan <psadhuk...@openjdk.org> wrote:
>>> I believe this is likely how layout is calculated. >> >> I just wanted to know "why 3 is chosen as a magic number ?". Actually the >> spacing with "4 * OFFSET" looks better between radio, icon and text of menu >> item (on win 11). > >> > I believe this is likely how layout is calculated. >> >> I just wanted to know "why 3 is chosen as a magic number ?". Actually the >> spacing with "4 * OFFSET" looks better between radio, icon and text of menu >> item (on win 11). > > I guess this is now taken care of in latest PR.. > @prsadhuk I tested on win11 and I think this should be OK. Although the gap > is not equal between RadioButton icon, imageIcon and text but as you said > above `text location as it is done in WindowsMenuItemUI#paintText which does > not have any knowledge of bullet/icon presence`, this may not be an issue. > > After changing `icon.paintIcon(c, g, x - OFFSET + ((skinWidth != -1) ? > skinWidth : 16), y + OFFSET);` to `icon.paintIcon(c, g, x - OFFSET + > ((skinWidth != -1) ? skinWidth - 1 : 15), y + OFFSET);` looks better (my > personal opinion) > > Same issue exist for JCheckBoxMenuItem as well, it's better to extend the > test for JCheckBoxMenuItem as well. The components can be re-arranged in a > grid panel to give better visual alignment (vertically aligned). It may look better with skinWidth -1 and 16-1 but the icon may overlap with bullet/checkmark skin by 1 pixel in that case, so for better consistency, I have kept it adrift of skinWidth and 16 is because normal icon is of 16x16 size, so in case there is no skin, then also 16 width is maintained I will work on the testcase to extend for JCheckBoxMenuItem.. ------------- PR Comment: https://git.openjdk.org/jdk/pull/23324#issuecomment-2638890130