diff --git a/MMTabBarView/MMTabBarView/MMTabBarButtonCell.m b/MMTabBarView/MMTabBarView/MMTabBarButtonCell.m index 90438c61..cc365e9d 100644 --- a/MMTabBarView/MMTabBarView/MMTabBarButtonCell.m +++ b/MMTabBarView/MMTabBarView/MMTabBarButtonCell.m @@ -1063,17 +1063,26 @@ - (void)_drawIconWithFrame:(NSRect)frame inView:(NSView *)controlView { [icon drawInRect:iconRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0 respectFlipped:YES hints:nil]; } +inline static bool useShadow(NSView* const inView) { + if (@available(macOS 10.14, *)) { + return ![[inView.effectiveAppearance bestMatchFromAppearancesWithNames:@[NSAppearanceNameAqua, NSAppearanceNameDarkAqua]] isEqualToString:NSAppearanceNameDarkAqua]; + } + return true; +} + - (void)_drawTitleWithFrame:(NSRect)frame inView:(NSView *)controlView { NSRect rect = [self titleRectForBounds:frame]; [NSGraphicsContext saveGraphicsState]; - - NSShadow *shadow = [[NSShadow alloc] init]; - [shadow setShadowColor:[NSColor.whiteColor colorWithAlphaComponent:0.4]]; - [shadow setShadowBlurRadius:1.0]; - [shadow setShadowOffset:NSMakeSize(0.0, -1.0)]; - [shadow set]; + + if (useShadow(controlView)) { + NSShadow *shadow = [[NSShadow alloc] init]; + [shadow setShadowColor:[NSColor.whiteColor colorWithAlphaComponent:0.4]]; + [shadow setShadowBlurRadius:1.0]; + [shadow setShadowOffset:NSMakeSize(0.0, -1.0)]; + [shadow set]; + } // draw title [self.attributedStringValue drawInRect:rect]; diff --git a/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/MMSafariTabStyle.m b/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/MMSafariTabStyle.m index 0cd54ece..043234fd 100644 --- a/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/MMSafariTabStyle.m +++ b/MMTabBarView/MMTabBarView/Styles/Safari Tab Style/MMSafariTabStyle.m @@ -367,6 +367,9 @@ -(void)drawBezelOfOverflowButton:(MMOverflowPopUpButton *)overflowButton ofTabBa -(void)drawBezelOfTabCell:(MMTabBarButtonCell *)cell withFrame:(NSRect)frame inView:(NSView *)controlView { + if (@available(macos 10.14, *)) { + return; + } if (cell.controlView.frame.size.height < 2) return; @@ -376,9 +379,6 @@ -(void)drawBezelOfTabCell:(MMTabBarButtonCell *)cell withFrame:(NSRect)frame inV NSRect cellFrame = frame; cellFrame = NSInsetRect(cellFrame, -5.0, 0); - - if (cell.controlView.frame.size.height < 2) - return; NSImage *left = nil; NSImage *center = nil;