Skip to content

Commit

Permalink
Merge pull request #6 from bhorn/master
Browse files Browse the repository at this point in the history
Fixed NSStatusItem's deprecated API.
  • Loading branch information
NSRover committed Jul 6, 2017
2 parents 62d3bf9 + 6925779 commit 9b3951e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions NinjaMode/AppDelegate.m
Expand Up @@ -3,6 +3,7 @@
// NinjaMode
//
// Created by Nirbhay Agarwal on 08/10/14.
// Updated by Benedikt-Alexander Mokroß on 21/04/2017 (Fixed depricated API).
// Copyright (c) 2014 NSRover. All rights reserved.
//

Expand All @@ -21,13 +22,15 @@ @implementation AppDelegate

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
self.statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength];
_statusItem.image = [NSImage imageNamed:@"switchIcon.png"];
[_statusItem.image setTemplate:YES];

_statusItem.highlightMode = NO;
_statusItem.toolTip = @"control-click to quit";
NSStatusBarButton* statusBarButton = _statusItem.button;
statusBarButton.image = [NSImage imageNamed:@"switchIcon.png"];
[statusBarButton.image setTemplate:YES];

[_statusItem setAction:@selector(itemClicked:)];
statusButton.highlighted = NO;
statusBarButton.toolTip = @"control-click to quit";

[statusBarButton setAction:@selector(itemClicked:)];

[self refreshDarkMode];
}
Expand Down

0 comments on commit 9b3951e

Please sign in to comment.