On Mon, 26 Jun 2023 11:52:34 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:
> 
>   Formatting

Would you mind updating the copyright years?

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

> 57:         UIManager.setLookAndFeel(
> 58:                
> "com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel");
> 59:         try {

Actually, I meant that you can skip checking for Windows at all: the test has 
`@requires (os.family == "windows")` tag. Then setting *Windows Classic Look 
and Feel* will fail on other platforms but Windows, that is 
`UIManager.setLookAndFeel` will throw an exception which will eventually fail 
the test.

Whatever way you prefer.

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

Marked as reviewed by aivanov (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/14555#pullrequestreview-1498547872
PR Review Comment: https://git.openjdk.org/jdk/pull/14555#discussion_r1242206200

Reply via email to