On Tue, 20 Jun 2023 10:04:53 GMT, Prasanta Sadhukhan <[email protected]> 
wrote:

> Title buttons under Widows Classic L&F got their sizes from the XP desktop 
> theme in which button width can be bigger than height. It is construed as XP 
> bug where sizes aren't updated properly so it uses height units for width for 
> XP and later windows. The proposed fix uses the [same 
> technique](https://github.com/openjdk/jdk/blob/a0595761ef35c4eec8cb84326a869b9473cd5bba/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsInternalFrameTitlePane.java#L78-L82)
>  for Classic and forces title buttons to be square and to fit the frame title 
> in height.
> 
> Before fix SwingSet2 demo (Windows Classic InternalFrame)
> ![image](https://github.com/openjdk/jdk/assets/43534309/3d6ec539-5e17-46ce-aba5-e724af6085fe)
> 
> After fix
> ![image](https://github.com/openjdk/jdk/assets/43534309/db0135e4-d7f3-41a4-bbfa-e8e95cbd071d)

test/jdk/javax/swing/JInternalFrame/InternalFrameTitleButtonTest.java line 102:

> 100:                 if (c instanceof JButton) {
> 101:                     Icon icon = ((JButton) c).getIcon();
> 102:                     if( icon.getIconHeight() > height - 4 ||

Suggestion:

                    if (icon.getIconHeight() > height - 4 ||

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14555#discussion_r1236924884

Reply via email to