From 0ed263d9296a96c18a604b5a5b6ba233b5d592d8 Mon Sep 17 00:00:00 2001 From: James Morris Date: Mon, 10 Oct 2022 19:09:39 -0400 Subject: [PATCH 1/2] Don't change to highlight color when menu is shown Starting at least in Catalina, it's not the style for menu bar items to change color when clicked. --- LCMenuIconView.m | 1 - 1 file changed, 1 deletion(-) diff --git a/LCMenuIconView.m b/LCMenuIconView.m index 5465261..f3f0610 100755 --- a/LCMenuIconView.m +++ b/LCMenuIconView.m @@ -32,7 +32,6 @@ - (void)drawRect:(NSRect)r { highlightActiveImage = [[NSImage imageNamed:@"highlightactive"] retain]; NSImage *i = isActive ? activeImage : inactiveImage; - if(menuIsShown) i = isActive ? highlightActiveImage : highlightImage; NSRect f = [self bounds]; NSPoint p = NSMakePoint(f.size.width/2 - [i size].width/2, f.size.height/2 - [i size].height/2 + 1); From 09934059c9dd32872082aba97cfec21753a99221 Mon Sep 17 00:00:00 2001 From: James Morris Date: Mon, 10 Oct 2022 19:17:11 -0400 Subject: [PATCH 2/2] Fix menu bar highlight logic Starting at least in Big Sur, the menu bar may display icons in dark/highlighted mode even if the system theme is not in dark mode. This can occur when the menu bar is shown in fullscreen mode or depending on the desktop wallpaper. --- LCMenuIconView.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LCMenuIconView.m b/LCMenuIconView.m index f3f0610..3eeba4a 100755 --- a/LCMenuIconView.m +++ b/LCMenuIconView.m @@ -22,8 +22,8 @@ - (void)drawRect:(NSRect)r { inactiveImage = [[NSImage imageNamed:@"inactive"] retain]; // Invert icons if in dark mode - NSString *mode = [[NSUserDefaults standardUserDefaults] stringForKey:@"AppleInterfaceStyle"]; - if([mode isEqualToString: @"Dark"]) { + NSString *mode = (NSString*)(self.effectiveAppearance.name); + if([[mode lowercaseString] containsString: @"dark"]) { activeImage = [[NSImage imageNamed:@"highlightactive"] retain]; inactiveImage = [[NSImage imageNamed:@"highlighted"] retain]; }