File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 1010 IBOutlet NSMenu *menu;
1111 IBOutlet NSArrayController *arrayController;
1212
13+ NSImage *regularIcon;
14+ NSImage *altIcon;
15+
1316 NSStatusItem *statusItem;
1417 NSString *shuttleConfigFile;
1518
Original file line number Diff line number Diff line change @@ -19,13 +19,28 @@ - (void) awakeFromNib {
1919
2020 // Load the menu content
2121 // [self loadMenu];
22+
23+ // Define Icons
24+ regularIcon = [NSImage imageNamed: @" StatusIcon" ];
25+ altIcon = [NSImage imageNamed: @" StatusIconAlt" ];
26+
27+ // Check for AppKit Version, add support for darkmode if > 10.9
28+ BOOL oldAppKitVersion = (floor (NSAppKitVersionNumber ) <= NSAppKitVersionNumber10_9 );
29+
30+ if (!oldAppKitVersion)
31+ {
32+ // 10.10 or higher, add support to icon for auto detection of Regular/Dark mode
33+ [regularIcon setTemplate: YES ];
34+ [altIcon setTemplate: YES ];
35+ }
2236
2337 // Create the status bar item
2438 statusItem = [[NSStatusBar systemStatusBar ] statusItemWithLength: 25.0 ];
39+
2540 [statusItem setMenu: menu];
2641 [statusItem setHighlightMode: YES ];
27- [statusItem setImage: [ NSImage imageNamed: @" StatusIcon " ] ];
28- [statusItem setAlternateImage: [ NSImage imageNamed: @" StatusIconAlt " ] ];
42+ [statusItem setImage: regularIcon ];
43+ [statusItem setAlternateImage: altIcon ];
2944
3045 launchAtLoginController = [[LaunchAtLoginController alloc ] init ];
3146
You can’t perform that action at this time.
0 commit comments