NSButton bordered=NO breaks focus ring custom mask

Originator:todd.thomas
Number:rdar://29465363 Date Originated:01-Dec-2016 02:09 PM
Status:Fixed Resolved:10.13
Product:macOS + SDK Product Version:10.12.1
Classification:UI/Usability Reproducible:Always
 
Area:
AppKit

Summary:
I wrote a test app to figure out why the focus rings on my custom buttons in Pastebot looked crappy. Turns out all you need is to set button.bordered = NO. Sample app included that shows the problem. Just because I don't want a border doesn't mean that I don't want to draw my own custom focus ring. I could be drawing my own border (like the SimpleButton I included in the sample code).

Steps to Reproduce:
1. Go to System Preferences > Keyboard > Shortcuts and make sure Full Keyboard Access is set to 'All controls'.
2. Compile Test app and run (10.12.1 and Xcode 8.1).
3. Press tab to go between the two buttons.
4. Notice that the button on the right has a crappy looking focus ring and doesn't use the custom ring mask at all like the left button does.
5.Check the AppDelegate.m class to see that the only difference between those two buttons is bordered = NO.

Expected Results:
Well I'd still like to draw my own mask on buttons that don't have borders. I have custom buttons where I do my own border drawing and those focus rings are also messed up and look bad.

Actual Results:
Focus rings that I can't seem to customize myself to look better. In addition you don't get the nice animation for the focus ring when it appears either.

Version:
macOS 10.12.1 16B2657

Notes:


Configuration:
I have only tested this on 10.12.1 with Xcode 8.1(8B62).

Attachments:
'FocusRingsTest.zip' was successfully uploaded.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!