Re: disabledControlTextColor magic ?
Re: disabledControlTextColor magic ?
- Subject: Re: disabledControlTextColor magic ?
- From: "Lars C. Hassing" <email@hidden>
- Date: Thu, 07 Mar 2019 20:31:07 +0000
- Thread-topic: disabledControlTextColor magic ?
Ah, just remembered Uli Kusterer's "NSRectFill considered harmful"
http://www.zathras.de/angelweb/blog-nsrectfill-considered-harmful.htm
I thought that disabledControlTextColor was gray, but it is black with an alpha
of 0.8!
NSRectFillUsingOperation(NSMakeRect(5,5,20,20),
NSCompositingOperationSourceOver);
made it work!
/Lars
Den 7. mar. 2019 kl. 20.33 skrev Lars C. Hassing
<email@hidden<mailto:email@hidden>>:
I wanted to take a good look at disabledControlTextColor (and othe system
colors), so I made a small test view with
- (void)drawRect:(NSRect)dirtyRect
{
[[NSColor windowBackgroundColor] set];
NSRectFill(dirtyRect);
NSColor *c = [NSColor disabledControlTextColor];
[c set];
NSRectFill(NSMakeRect(5,5,20,20));
[@"disabledControlTextColor" drawInRect:NSMakeRect(30,5,200,20)
withAttributes:@{NSForegroundColorAttributeName : c}];
}
However, the rect always turns up black!
The text is gray, see https://pasteboard.co/I4mjN99.png
How is it possible that disabledControlTextColor only has effect for text ?
/Lars
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden