mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-20 21:43:08 +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)menuWillOpen:(NSMenu*)menu;
|
||||||
- (void)menuDidClose:(NSMenu*)menu;
|
- (void)menuDidClose:(NSMenu*)menu;
|
||||||
|
|
||||||
|
- (void)darkModeChanged:(NSNotification*)note;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -44,7 +44,19 @@
|
|||||||
name:StatusUpdateKey
|
name:StatusUpdateKey
|
||||||
object:nil];
|
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"];
|
self.statusItem.image = [NSImage imageNamed:@"MenuBarIconMac"];
|
||||||
|
}
|
||||||
|
|
||||||
|
[[NSDistributedNotificationCenter defaultCenter] addObserver:self
|
||||||
|
selector:@selector(darkModeChanged:)
|
||||||
|
name:@"AppleInterfaceThemeChangedNotification"
|
||||||
|
object:nil];
|
||||||
|
|
||||||
[self buildMenu];
|
[self buildMenu];
|
||||||
|
|
||||||
@ -82,6 +94,9 @@
|
|||||||
|
|
||||||
- (void)applicationWillTerminate:(NSNotification *)aNotification {
|
- (void)applicationWillTerminate:(NSNotification *)aNotification {
|
||||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||||
|
[[NSDistributedNotificationCenter defaultCenter] removeObserver:self
|
||||||
|
name:@"AppleInterfaceThemeChangedNotification"
|
||||||
|
object:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)showNetworks {
|
- (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
|
@end
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "mac",
|
"idiom" : "mac",
|
||||||
"filename" : "MenuBar@2x.png",
|
|
||||||
"scale" : "2x"
|
"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