-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8365625: Can't change accelerator colors in Windows L&F #26826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
8365625: Can't change accelerator colors in Windows L&F #26826
Conversation
👋 Welcome back aivanov! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
@aivanov-jdk The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
@aivanov-jdk this pull request can not be integrated into git checkout 8365625-accelator-colors-WindowsLAF
git fetch https://git.openjdk.org/jdk.git pr/26783
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge pr/26783"
git push |
Color acceleratorForeground = UIManager.getColor("MenuItem.acceleratorForeground"); | ||
Color acceleratorSelectionForeground = UIManager.getColor("MenuItem.acceleratorSelectionForeground"); | ||
UIManager.put("MenuItem.acceleratorForeground", Color.GREEN); | ||
UIManager.put("MenuItem.acceleratorSelectionForeground", Color.RED); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are testing 2 of 3 static fields..I guess since we do not have test for these fields explicitly, we can test the 3rd one too which is disabledForeground
like putting UIManager.put("MenuItem.disabledForeground", Color.BLUE)
and do quit.setEnabled(false)
in which case it should be BLUE
The parent pull request that this pull request depends on has now been integrated and the target branch of this pull request has been updated. This means that changes from the dependent pull request can start to show up as belonging to this pull request, which may be confusing for reviewers. To remedy this situation, simply merge the latest changes from the new target branch into this pull request by running commands similar to these in the local repository for your personal fork: git checkout 8365625-accelator-colors-WindowsLAF
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# if there are conflicts, follow the instructions given by git merge
git commit -m "Merge master"
git push |
Problem:
The colors for the accelerators are cached in static fields:
disabledForeground
,acceleratorSelectionForeground
andacceleratorForeground
. 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 fromBasicMenuItemUI
, 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 that was resolved in #26743.
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/26826/head:pull/26826
$ git checkout pull/26826
Update a local copy of the PR:
$ git checkout pull/26826
$ git pull https://git.openjdk.org/jdk.git pull/26826/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 26826
View PR using the GUI difftool:
$ git pr show -t 26826
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26826.diff
Using Webrev
Link to Webrev Comment