On Thu, 22 Jun 2023 20:35:45 GMT, Alexey Ivanov <[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.. ------------- PR Comment: https://git.openjdk.org/jdk/pull/14555#issuecomment-1603647188
