mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-30 01:38:53 +00:00
* Fixed menu icon size
* Added icon for dark mode * Added detection for interface mode changing from light to dark and adjusting the icon accordingly
This commit is contained in:
parent
a7b635a980
commit
73fd934fec
@ -46,4 +46,6 @@
|
||||
- (void)menuWillOpen:(NSMenu*)menu;
|
||||
- (void)menuDidClose:(NSMenu*)menu;
|
||||
|
||||
- (void)darkModeChanged:(NSNotification*)note;
|
||||
|
||||
@end
|
||||
|
@ -44,7 +44,19 @@
|
||||
name:StatusUpdateKey
|
||||
object:nil];
|
||||
|
||||
NSString *osxMode = [defaults stringForKey:@"AppleInterfaceStyle"];
|
||||
|
||||
if(osxMode != nil && [osxMode isEqualToString:@"Dark"]) {
|
||||
self.statusItem.image = [NSImage imageNamed:@"MenuBarIconMacWhite"];
|
||||
}
|
||||
else {
|
||||
self.statusItem.image = [NSImage imageNamed:@"MenuBarIconMac"];
|
||||
}
|
||||
|
||||
[[NSDistributedNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(darkModeChanged:)
|
||||
name:@"AppleInterfaceThemeChangedNotification"
|
||||
object:nil];
|
||||
|
||||
[self buildMenu];
|
||||
|
||||
@ -82,6 +94,9 @@
|
||||
|
||||
- (void)applicationWillTerminate:(NSNotification *)aNotification {
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
[[NSDistributedNotificationCenter defaultCenter] removeObserver:self
|
||||
name:@"AppleInterfaceThemeChangedNotification"
|
||||
object:nil];
|
||||
}
|
||||
|
||||
- (void)showNetworks {
|
||||
@ -277,4 +292,15 @@
|
||||
|
||||
}
|
||||
|
||||
- (void)darkModeChanged:(NSNotification*)note {
|
||||
NSString *osxMode = [[NSUserDefaults standardUserDefaults] stringForKey:@"AppleInterfaceStyle"];
|
||||
|
||||
if(osxMode != nil && [osxMode isEqualToString:@"Dark"]) {
|
||||
self.statusItem.image = [NSImage imageNamed:@"MenuBarIconMacWhite"];
|
||||
}
|
||||
else {
|
||||
self.statusItem.image = [NSImage imageNamed:@"MenuBarIconMac"];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -7,7 +7,6 @@
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"filename" : "MenuBar@2x.png",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 17 KiB |
20
ZeroTier One/Assets.xcassets/MenuBarIconMacWhite.imageset/Contents.json
vendored
Normal file
20
ZeroTier One/Assets.xcassets/MenuBarIconMacWhite.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"filename" : "MenubarWhite.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
},
|
||||
"properties" : {
|
||||
"template-rendering-intent" : "template"
|
||||
}
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 17 KiB |
Loading…
Reference in New Issue
Block a user