diff options
author | Tobias Markmann <tm@ayena.de> | 2019-03-19 15:46:25 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2019-03-19 15:46:25 (GMT) |
commit | 16f15b8d80f648b61e991b04800c23368dcd38a5 (patch) | |
tree | 2bfa6b75e7c9844df4266e93856b2b0019dcea79 /Slimber/Cocoa | |
parent | 69d2dffcde9bb0fac4293e2a04e99117a6984090 (diff) | |
download | swift-16f15b8d80f648b61e991b04800c23368dcd38a5.zip swift-16f15b8d80f648b61e991b04800c23368dcd38a5.tar.bz2 |
Replace use of Cocoa API deprecated in 10.14 in Slimber
macOS 10.14 started to deprecate some old Cocoa API.
This replaces use of the deprecated API with newer Cocoa
API.
Test-Information:
Still builds fine on macOS 10.14.3. Verified that Slimber
still works as expected.
Change-Id: Id772af58b3fd233ecf829b80eca59815184a6113
Diffstat (limited to 'Slimber/Cocoa')
-rw-r--r-- | Slimber/Cocoa/CocoaMenulet.mm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Slimber/Cocoa/CocoaMenulet.mm b/Slimber/Cocoa/CocoaMenulet.mm index a05843e..3bb39da 100644 --- a/Slimber/Cocoa/CocoaMenulet.mm +++ b/Slimber/Cocoa/CocoaMenulet.mm @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2016 Isode Limited. + * Copyright (c) 2012-2019 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -17,9 +17,9 @@ CocoaMenulet::CocoaMenulet() { statusItem = [[[NSStatusBar systemStatusBar] statusItemWithLength: NSVariableStatusItemLength] retain]; - [statusItem setHighlightMode: YES]; - [statusItem setEnabled: YES]; - [statusItem setToolTip: @"Slimber"]; + [statusItem.button.cell setHighlightsBy: NSChangeGrayCellMask | NSChangeBackgroundCellMask]; + [statusItem.button setEnabled: YES]; + [statusItem.button setToolTip: @"Slimber"]; [statusItem setMenu: menu]; } @@ -32,7 +32,7 @@ CocoaMenulet::~CocoaMenulet() { void CocoaMenulet::setIcon(const std::string& icon) { NSString* path = [[NSBundle mainBundle] pathForResource: std2NSString(icon) ofType:@"png"]; NSImage* image = [[NSImage alloc] initWithContentsOfFile: path]; - [statusItem setImage: image]; + [statusItem.button setImage: image]; [image release]; } |