RFR: 8365625: Can't change accelerator colors in Windows L&F [v3]
Alexey Ivanov
aivanov at openjdk.org
Mon Sep 29 19:52:18 UTC 2025
On Tue, 16 Sep 2025 15:33:07 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:
>> **Problem:**
>>
>> The colors for the accelerators are cached in static fields: `disabledForeground`, `acceleratorSelectionForeground` and `acceleratorForeground`. As soon as this field is set to a non-`UIResource` value, the value cannot change.
>>
>> **Fix:**
>>
>> Remove the static fields for accelerator from `WindowsMenuItemUI` and use the fields inherited from `BasicMenuItemUI`, pass these fields as parameters to static methods.
>>
>> Additionally, I formatted the calls to `WindowsMenuItemUI.paintMenuItem` in one consistent way.
>>
>> I removed the redundant javadoc from `paintMenuItem` and added the missing `@Override` annotation.
>>
>> I provided a regression test. The test also reproduces [JDK-8365375](https://bugs.openjdk.org/browse/JDK-8365375) that was resolved in #26743.
>
> Alexey Ivanov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains nine commits:
>
> - Update instructions to include the set of disabled menu items
> - Add disabled menu items to verify for MenuItem.disabledForeground
> - Merge master
> - Merge master
> - Align parameter list in WindowsMenuUI.paintMenuItem.
> - Merge master
>
> Accepted the versions of
> * WindowsCheckBoxMenuItemUI.java
> * WindowsMenuItemUI.java
> * WindowsMenuUI.java
> * WindowsRadioButtonMenuItemUI.java
> that existed in my branch.
> - 8365625: Can't change accelerator colors in Windows L&F
> - 8365389
> - 8365389
Any volunteers to review?
@prsadhuk Any other comments?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/26826#issuecomment-3348796197
More information about the client-libs-dev
mailing list