NSButton: no modern way to use a custom disabled title color without private api

Originator:todd.thomas
Number:rdar://29555377 Date Originated:07-Dec-2016 10:36 AM
Status:Open Resolved:
Product:macOS + SDK Product Version:10.12
Classification: Reproducible:Always
 
Area:
AppKit

Summary:
Because of custom focus ring issues (rdar://problem/29465363) I started converting one of our main NSButton subclasses to use layers instead of having the cell or image do any drawing in -drawRect: or drawTitle:WithFrame:inView. (Overriding either of these causes the focus ring to look like crap - see radar listed above). 

The one issue I ran into is that I could no longer specify a custom color for disabled text. In my old code I used -drawTitle:withFrame:inView: and used my own attributed string with the customized disabled color if the button was disabled. Since I can't use that method in a modern layer backed button subclass (when I implement it the button goes back to using legacy crappy focus rings) I needed to find some other way.

Currently as far as I can tell the only way to change the disabled text color is to override _textDimColor in an NSButtonCell subclass. Since our apps are generally sold in the App Store using private api is kind of frowned upon.

So if possible could you give us a non-private api that would allow some of our custom buttons to have a different disabled text color? Our designer here is really really picky with his colors.

Steps to Reproduce:
n/a
If you'd like I could submit a test app with my custom NSButton class and show you the issues when NSButtonCell -drawTitle:withFrame:inView: is implemented.

Expected Results:
n/a

Actual Results:
n/a

Version:
10.12.1/Xcode 8.1

Notes:


Configuration:
n/a

Attachments:

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!