Reputation: 147
How to apply tint color to NSButton of style inline
and visual bordered
Below is block of code i am using
After using the below code
InlineButton.wantsLayer = YES;
InlineButton.layer.backgroundColor = [NSColor redColor].CGColor;
how to change only tint of button
Any suggestion would be more helpful.
Upvotes: 3
Views: 2289
Reputation:
Example (Swift):
/// The system window mockup
var layer = self.systemWindowMockupView.layer
layer?.cornerRadius = 6
layer?.backgroundColor = settings.windowBackgroundColor?.cgColor
layer?.masksToBounds = true. // <<<---- This is what you're looking for
Upvotes: 0
Reputation: 987
The isBordered
property of button is related with bezelStyle
property. You can set different style to check the appearance.
And if you want button image have specific color. Try use the template image and contentTintColor
.
let button = NSButton()
button.image = NSImage(named: NSImage.stopProgressFreestandingTemplateName)
button.image?.isTemplate = true
button.bezelStyle = .inline
button.isBordered = false
button.contentTintColor = NSColor.red
Upvotes: 6