RFR: 7124282: [macosx] Can't see table cell highlighter when the highlight border is the same color as the cell. [v3]
Harshitha Onkar
duke at openjdk.java.net
Wed Mar 30 02:05:46 UTC 2022
On Tue, 29 Mar 2022 07:22:55 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
>> @prsadhuk I have pushed latest changes related to AquaLookAndFeel.java file only. The CSystemColors.m is not checked-in because of [selectedContentBackgroundColor](https://developer.apple.com/documentation/appkit/nscolor/2998830-selectedcontentbackgroundcolor) type property build issues.
>>
>>
>>> In my testing in osx10.15 with your fix, I see focus ring is following highlight color and not accent color...did you modify anything in your fix? <img alt="Screenshot 2022-03-28 at 11 52 09 AM" width="688" src="https://user-images.githubusercontent.com/43534309/160338556-117c8e9b-4e78-4368-8040-dfca1d82e1ab.png">
>>
>> For this scenario, wanted to verify if the **selectionBackground** explicitly set to green in AquaLookAndFeel?
>
> With latest repo and your fix, I put a debug log in deriveContrastFocusRing() and it seems to produce this output (for scenario above)
>
> selectedBackgroundColor com.apple.laf.AquaImageFactory$SystemColorProxy[r=54,g=128,b=34]
>
> I see, even if I change the highlight Color to blue, it does not call deriveContrastFocusRing() again and the focus ring remains green although background Color of JTable cell changes to blue [ I think deriveContrastFocusRing needs to be called every time accent color is changed in System->Preferences]
>
> <img width="537" alt="Screenshot 2022-03-29 at 12 49 59 PM" src="https://user-images.githubusercontent.com/43534309/160556234-cf1732f3-57bd-4530-82e6-e2080e9e1551.png">
> .
I'm currently testing on mac 11.6 and observe that the background color for JTable follows accent color changes (in mac 11.6). Below are screenshots on mac 10.15 vs mac 11.6 under same settings
On Mac 10.15, JTable's background color seems to follow the highlight color changes whereas in 11.6 it follows the accent color changes. In both versions the selectionBackground is obtained from the same property - **alternateSelectedControlColor**

The other issue which was related to on-the-fly accent/highlight color changes corresponding to following case - **deriveContrastFocusRing needs to be called every time there is change to System Preference colors** is fixed and the code will be pushed shortly.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7768
More information about the client-libs-dev
mailing list