-
Notifications
You must be signed in to change notification settings - Fork 5.8k
JDK-8287261: [macos] JList Focus Ring color doesn't follow Accent color changes on macOS #8896
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
Conversation
👋 Welcome back honkar! A progress list of the required criteria for merging this PR into |
@honkar-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
|
|
||
if (errorLog.isEmpty()) { | ||
System.out.println("Test passed !!"); | ||
} |
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.
} else {
Can be in same line. (Applies to other places also)
.get(prefix + ".selectionBackground"); | ||
} | ||
|
||
if (UIManager.getDefaults().get("CellFocus.color") != null |
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.
if (UIManager.getDefaults().get("CellFocus.color") != null
&& UIManager.getDefaults().get("CellFocus.color")
instanceof Color)
can be changed into
if (UIManager.getDefaults().get("CellFocus.color")
instanceof Color)
Since if the object is null then instanceof
returns false.
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.
@TejeshR13 Your suggestion was to remove redundant null check. Correct, this is a better way to shorten the condition. Will have the changes done in the next commit.
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.
Updated PR with changes
Can you please double check how the native applications/components look when the colors are "similar". |
@mrserb There are different variations in the native applications - On Reminders App the background color remains the same (light gray) irrespective of changes in accent color. Under notification settings - the background color changes with accent color but it doesn't have a focus ring. At present a focus ring is added to JLists, but since it is almost the same color as the background it is not visible. To keep it consistent with JTable changes, the ring color is made brighter and prominent. Please let me know your suggestion or thoughts on the changes. |
In "Finder" lists, it is always gray |
Based on @prsadhuk and @mrserb suggestions and the JList LAF on native applications, the cell focus ring might not be required. At present, the JList background color changes with accent color and does not require any additional fix. Hence will be withdrawing this PR. |
With the proposed fix, JList's focus ring color follows accent color changes. Previously the focus ring for JList was not prominently visible and did not follow accent color changes.
While investing a similar issue related to JTable (#7768 (comment)), it was observed that List.focusCellHighlightBorder was using the cellFocusRing color as well. This PR extends the focus ring accent color changes to JLists.
Related issues: JDK-7124282 , JDK-8261243
Summary of changes
AquaLookAndFeel
changed which is used for cell border for lists and tableschangeFocusRingColor()
) for re-usabilitychangeFocusRingColor()
called when PropertyChangeEvent == FRAME_ACTIVE_PROPERTY and the frame gains focus, instead of calling in individualswapSelectionColors
inAquaFocusHandler.java
CellFocusRingTest
, which tests for both cases - Tables & Lists.Before and After screenshots of JList (Screenshots from SwingSet2 demo)
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/8896/head:pull/8896
$ git checkout pull/8896
Update a local copy of the PR:
$ git checkout pull/8896
$ git pull https://git.openjdk.java.net/jdk pull/8896/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 8896
View PR using the GUI difftool:
$ git pr show -t 8896
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/8896.diff