On Fri, 23 Jun 2023 03:55:09 GMT, Prasanta Sadhukhan <[email protected]> 
wrote:

> > > > I wonder if the values stored in the UI Manager should have this trick 
> > > > applied rather tweaking the values on the fly. If a programmer gets the 
> > > > values from `UIManager` directly, they will get the incorrect value.
> > > 
> > > 
> > > OK. UIManager is also updated with updated width so values will be 
> > > identical
> > 
> > 
> > Can it be modified so that the value for `"InternalFrame.titleButtonWidth"` 
> > gets computed based on `"InternalFrame.titleButtonHeight"` using the 
> > algorithm in `WindowsIconFactory.java` and 
> > `WindowsInternalFrameTitlePane.java` when its value is requested?
> > This way UIManager automatically returns the value we want; the adjustment 
> > logic can be dropped from both classes above.
> 
> We probably can change in 
> [WindowsLookAndFeel](https://github.com/openjdk/jdk/blob/5a82fa3bb278b5b80b9ede0619f364fe13cdbede/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java#L813-L814)
>  but for XPtheme `width = height-4` and for ClassicTheme `width = height-2` 
> so we need `getXP ` check so I will prefer to keep it as it is as otherwise 
> it might create regression and also I could not find anyway to access 
> WIndowsInternalFrameTitlePane methods in WindowsIconFactory to avoid 
> duplication..

Having said that, I guess XP theme also padding is not correct as can be seen 
in this bug [JDK-8139392](https://bugs.openjdk.org/browse/JDK-8139392) which I 
have rectified

After fix
![image](https://github.com/openjdk/jdk/assets/43534309/224f098c-5ff5-4713-8434-05d99e7d9a71)

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

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

Reply via email to