On Mon, 10 Jul 2023 09:49:21 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)
>
> Prasanta Sadhukhan has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Review comments

May I suggest a simplified version of the test 
[`InternalFrameTitleButtonTest.java`](https://github.com/aivanov-jdk/jdk/blob/6decd8ae82ed95f0c4bda9089d1e05eb084567b9/test/jdk/javax/swing/JInternalFrame/InternalFrameTitleButtonTest.java)?

Its `test` method is shorter; I moved the condition to its own method 
`testButtonSize` where an internal frame title button is passed as well as an 
offset for width that is different for classic and visual-style-enabled L&F. 
This also avoids checking which L&F is selected.

Here's [the 
diff](https://github.com/aivanov-jdk/jdk/compare/ec2c9ab..6decd8a#diff-f941d2d497179f4da7530480b24522ccd05da02ca24c6e3fa55824d4199529e1)
 on top of your latest update.

What do you think?

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

PR Comment: https://git.openjdk.org/jdk/pull/14555#issuecomment-1629282273

Reply via email to