NSButton corner radius and NSPopover

Viewed 1263

I'm using an NSPopover and I'm putting a NSViewController inside to be displayed as a custom view from a NSStatusItem. Most of the view controller displays correctly except for the NSButton that have a corner radius on them. There is some extra white leaking out where the rounded corners are being applied. Displaying the buttons within the actual app, this problem doesn't occur.

I feel it has to do something with the NSPopover appearance which I have set to "NSAppearanceNameAqua".

The NSButtons are within a NSView which are displayed in a NSTableView and are set to this style.

    self.createdButton.wantsLayer = true
    self.createdButton.layer?.backgroundColor = Utils.blackColor().CGColor
    self.createdButton.layer?.masksToBounds = true
    self.createdButton.layer?.cornerRadius = 5

enter image description here enter image description here

The top image is when the actual app is open. The bottom image is when the view controller is being shown within a NSPopover.

1 Answers
Related