On Mon, 11 Apr 2022 06:24:46 GMT, Harshitha Onkar <d...@openjdk.java.net> wrote:

>> "accentColor" is swift property so not usable for jdk but you can use 
>> "controlAccentColor" which seems to work with 10.15 and 12.1 as per my 
>> limited testing.
>> You need to use @available check though..
>> Even though it may not work for version lesser than 10.14, I guess it's ok 
>> as those versions are more or less obsolete and we will not be worse off 
>> than where we are now...
>> While you are at it, please consider renaming this function as told.
>
> @prsadhuk Update PR with the recommended changes. The "controlAccentColor" 
> changes works as expected in Mac 12.3 as well. 
> One thing that I wanted to clarify with the fix is - the focus ring color 
> ("Focus.ring") is used at two other places AquaButtonUI and AquaFocus (for 
> focused icon). With the current fix I'm setting **KEYBOARD_FOCUS_COLOR** as 
> below - 
> 
> <img width="1092" alt="image" 
> src="https://user-images.githubusercontent.com/95945681/162673487-26006ca1-9373-4fe7-8f0b-f99cd47b2eb7.png";>
> 
> Before and After images of focused icon -
> 
> **Before**
> 
> <img width="185" alt="image" 
> src="https://user-images.githubusercontent.com/95945681/162674337-ebbfea9f-e753-4b4c-a624-7cef5b8d8c1b.png";>
> 
> **After (focus around icon slightly darker - focus ring color obtained from 
> controlAccentColor property)**
> 
> <img width="198" alt="image" 
> src="https://user-images.githubusercontent.com/95945681/162674444-b917de71-8e91-472e-a8f0-da48df0a43a5.png";>
> 
> Please let me know in case I need to add a NEW color (as shown below) instead 
> of reusing the KEYBOARD_FOCUS_COLOR if the color effects on focused icon/ 
> button doesn't look correct.
> 
> <img width="1099" alt="image" 
> src="https://user-images.githubusercontent.com/95945681/162675955-efd9c77f-6d7b-41e7-803a-50f49154fba5.png";>

It seems KEYBOARD_FOCUS_COLOR via `focusRingColor` is also used for 
menuSelectedBackgroundColor which is used for 

CheckBoxMenuItem.selectionBackground
ComboBox.selectionBackground
Menu.selectionBackground
MenuBar.selectionBackground
MenuItem.selectionBackground
"PopupMenu.selectionBackground", menuSelectedBackgroundColor,
RadioButtonMenuItem.selectionBackground

which might also get affected if you use new property, so you need to test all 
those widgets if you intend to use reuse KEYBOARD_FOCUS_COLOR  so I guess safe 
bet is to use new color as you mentioned to limit the change to highlight color.

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

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

Reply via email to