martinjbaker
martinjbaker

Reputation: 1484

Can't disable background blur with NSPopover

I'm having no luck trying to get NSPopover back to its 10.9 appearance when running in 10.10. I have a popover which is attached to an NSView that the user drags around. The popover must be transparent so the user can still see the position of the other UI elements underneath.

All works fine under 10.9 but now under 10.10 with Apple's new gimmicky blurs, I can't seem to get back to the same appearance on 10.10 (unless like me, the user has enabled "Reduce Transparency" in System Preferences > Accessibility. A preference change I can't enforce on end users!).

Have tried:

self.draggingPopover.appearance = NSPopoverAppearanceHUD;
self.popoverView.superview.appearance = [NSAppearance appearanceNamed:NSAppearanceNameAqua];
self.popoverView.appearance = [NSAppearance appearanceNamed:NSAppearanceNameAqua];

None of which make any difference to the popover's appearance on screen.

drawRect in my view subclass fills the background with my chosen color but ignores the alpha value and the popover is opaque.

Similarly I can use self.popoverView.layer.backgroundColor = ... but the alpha value is ignored there too!

Upvotes: 3

Views: 1305

Answers (3)

Clifton Labrum
Clifton Labrum

Reputation: 14168

You can set the Aqua appearance in the storyboard as well. Select the NSPopover's content view and use this setting:

enter image description here

Upvotes: 0

Taylor
Taylor

Reputation: 3231

If a requirement is that the popover is transparent (regardless of any future design changes to popover), could you just set the popover window's (i.e. the popoverView's -window) alphaValue to some other value < 1.0?

Upvotes: 0

Sinisa Drpa
Sinisa Drpa

Reputation: 917

Use:

[popover setAppearance:(NSPopoverAppearance)[NSAppearance appearanceNamed:NSAppearanceNameAqua]];

Upvotes: 1

Related Questions