Reputation: 5576
I have NSPopover
with NSBox
and subviews are: MKMapView
and NSImageView
. In dark mode the whole NSBox adds gamma/tint to all subviews. This doesn't appear in light mode (compare images below). It seems to be something with NSVisualEffectView
. How can I prevent/disable this effect?
PS: This effect doesn't show in normal window. Only popover is affected.
Code out of the box drag&drop elements. Mojave 10.14.4
- (IBAction)showPopover:(id)sender {
[[self popover] showRelativeToRect:[sender bounds] ofView:sender preferredEdge:NSRectEdgeMaxX];
}
Edit: APR2020
According to "Adopting advanced features of the new ui of os x yosemite" (youtube) this happens because of some vibrancy effect of the fill color. Popover has effective appearance of NSVibrantDarkAppearance
(lldb) po [self.view .effectiveAppearance]
▿ 1 element
- 0 : <NSCompositeAppearance: 0x60000210a940
(
"<NSVibrantDarkAppearance: 0x60000170b840>",
"<NSDarkAquaAppearance: 0x60000170ae80>",
"<NSSystemAppearance: 0x60000170afc0>"
)>
lldb) po [self.view .superview]
▿ 1 element
▿ 0 : Optional<NSView>
- some : <NSPopoverFrame: 0x1020a63f0; material: Popover; blendingMode: BehindWindow; state: Active>
So other possible solution is to use fill color which is not vibrant.
Upvotes: 0
Views: 302
Reputation: 5576
Solved by adding extra NSVisualEffectView
behind the NSBox
where blending is set to happen within window. left(with visual effect view), right (without).
Upvotes: 2