NSButton on NSVisualEffectView: wrong background color

I have an NSVisualEffectView in NSPopover designed for 10.10 .

When subclassing NSVisualEffectView to have a background color effect, the color of the borderless button looks different

gray box

I tried to set the backgroundColorbutton cells to clearColoror in the same way as I used to drawRect:in NSVisualEffectView , the first one gives the wrong color (not filled with blue), and later the same one with the wrong color. (gray frame around the border).

CALayer can fix this, but is there a way without using it?

Any ideas?

+4
source share
1

:

button.wantsLayer = true
button.layer?.backgroundColor = NSColor.clearColor().CGColor

NSTableView NSVisualEffectView. NSTableViewCell drawRect.

+3

All Articles