Bleed Through from Nsbutton Checkbox on Non-Transparent Nspopover

Bleed through from NSButton checkbox on non-transparent NSPopover

The answer, thanks to Willeke, is to add this within AppDelegate.applicationDidFinishLaunching()

    popover.appearance = NSAppearance(named: .aqua)

NSSegmentedControl - Odd appearance when placed in blur view

Apparently, labels inside NSSegmentedControl ignore vibrancy effect.

To fix it, put NSSegmentedControl inside NSVisualEffectView with material set to popover.

transparent separator line based on nsbox

You can do it by setting color with alpha like this:

[boxOutlet setFillColor:[NSColor colorWithCalibratedRed:0 green:0 blue:0 alpha:0.5]];

It will fill NSBox with black 50% transparency. Alpha is opacity value.

Note: boxOutlet is IBOutlet of NSBox.

Result:

Screenshot

Transparent rounded window but with opaque controls

So unsurprisingly, Matt Gemmell's code works just fine and I had made a mistake. I forgot that I was also messing with the alpha of the window elsewhere in my code in order to make it fade out on close.

To to sum it up for others running into this issue, if you set the alpha on the NSWindow the controls in that window will also be transparent. Instead set the alpha on the NSBezierPath fill color in the NSView. Just like Matt Gemmell's code does. :)



Related Topics



Leave a reply



Submit