RFR: 7124282: [macosx] Can't see table cell highlighter when the highlight border is the same color as the cell. [v3]

Prasanta Sadhukhan psadhukhan at openjdk.java.net
Fri Mar 25 08:00:43 UTC 2022


On Fri, 25 Mar 2022 00:02:21 GMT, Harshitha Onkar <duke at openjdk.java.net> wrote:

>> I guess using "color close to selection background color" seems wrong to me...either we need to use "blue" as used in native Numbers app...or if we need to use system color, then maybe use the accent color (as defined in System Preference) as focus ring color [ there's another Apple bug [JDK-8261243](https://bugs.openjdk.java.net/browse/JDK-8261243) of JDK not following accent color for focus ring for some widgets]...
>
> @prsadhuk Thank you for mentioning [JDK-8261243](https://bugs.openjdk.java.net/browse/JDK-8261243) issue. It is similar to the JTable cell focus ring. 
> 
> If we decide to go with the blue focus ring it would cause the same issue as described in [JDK-8261243](https://bugs.openjdk.java.net/browse/JDK-8261243)
> 
> If we choose the system color approach, below are my observations -
> 
> The selectionBackground in JTable matches the accent color. The selectionBackground is a system color that maps to [alternateSelectedControlColor](https://developer.apple.com/documentation/appkit/nscolor/1533135-alternateselectedcontrolcolor) type property. On the right we can see that the selectionBackground color of JTable (which matches the accent color). 
> 
> ![image](https://user-images.githubusercontent.com/95945681/160025649-565b8e9e-6c32-4823-9971-c7573eec1451.png)
> 
> Since the selectionBackground color for JTable is same as the accent color the focus ring won't be visible unless it is **LIGHTER** than accent color as suggested in the [JDK-8261243](https://bugs.openjdk.java.net/browse/JDK-8261243). We could change the present code not to do any hue offsets which would look as follows -
> 
> ![image](https://user-images.githubusercontent.com/95945681/160028845-6f78f81c-7028-4951-a3c5-aea5beb23fdb.png)

I guess "selectionBackground" matches the "highlight" color which seems to follow accent color, by default but we can make highlight color different from accent color, but in this case focus color should match accent color, not highlight color...please confirm if this is what is happening..
Also, alternateSelectedControlColor is deprecated so you should consider replacing with [selectedContentBackgroundColor](https://developer.apple.com/documentation/appkit/nscolor/2998830-selectedcontentbackgroundcolor)

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

PR: https://git.openjdk.java.net/jdk/pull/7768



More information about the client-libs-dev mailing list