Re: Yosemite-like Toolbar: Segmented Controls, Buttons, Template Images?
Re: Yosemite-like Toolbar: Segmented Controls, Buttons, Template Images?
- Subject: Re: Yosemite-like Toolbar: Segmented Controls, Buttons, Template Images?
- From: Ken Thomases <email@hidden>
- Date: Thu, 18 Dec 2014 00:32:04 -0600
On Dec 17, 2014, at 11:40 PM, Jerry Krinock <email@hidden> wrote:
> • It would be *really* nice if -[NSImage setTemplate:YES] sent to a monochrome image would cause it to reverse brightness depending on the highlight color, the way it works with Status Item icons in the menu bar, or even better yet, turn blue like they do in Xcode when selected. That sure seems like the way a “template” image should work. Am I missing some trick?
Just to be clear, a template image should not be black and white. It should be black and clear. Or, more accurately, the only thing that matters is the alpha channel.
If you use a proper template image in a button whose showsStateBy includes NSChangeBackgroundCellMask, it will show a blue effect when the button's state is NSOnState. (You don't normally explicitly set the showsStateBy of a button's cell, although you certainly can. Usually you set a button's type in IB or via -setButtonType:. For example, set it to NSToggleButton.)
I typically use Round Textured / Toggle buttons and Textured Square segmented controls in a toolbar with template images. They look correct on Yosemite.
Regards,
Ken
_______________________________________________
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