On Tue, 12 Aug 2025 12:21:49 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:

>> OK, thanks. Let's file a follow-up bug to capture this.
>
>> The formula doesn't look right. Why do you subtract `rect.x` and `rect.y` 
>> instead of `insets.left` and `insets.top`?
>> 
>> This would work correctly if both `rect.x` and `rect.y` are zero, but it 
>> would give wrong results in other cases.
> 
> I've submitted [JDK-8365379](https://bugs.openjdk.org/browse/JDK-8365379): 
> _SU3.applyInsets may produce wrong results_.

This thread mixes different issues now: `SwingUtilities3.applyInsets` that 
started this discussion as well as static fields added to `SwingUtilities3` and 
`WindowsMenuItemUI`.

@prsadhuk @kevinrushforth @prrace

For `SwingUtilities3.applyInsets`, I submitted 
[JDK-8365379](https://bugs.openjdk.org/browse/JDK-8365379). Prasanta has 
already started code review for it: #26743.

To clean up the code and get rid of static fields for colors, I submitted 
[JDK-8365389](https://bugs.openjdk.org/browse/JDK-8365389): *Remove static 
color fields from SwingUtilities3 and WindowsMenuItemUI*. I added other 
unresolved comments into this bug such as redundant static methods in 
`WindowsMenuItemUI`, missing `@Override` annotations. I also included my 
suggestion for using a new class `sun.swing.MenuItemRenderHelper` (or an 
existing `sun.swing.MenuItemLayoutHelper`) instead of `SwingUtilities3` for the 
helper menu rendering methods.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23324#discussion_r2270012169

Reply via email to