From 16f15b8d80f648b61e991b04800c23368dcd38a5 Mon Sep 17 00:00:00 2001 From: Tobias Markmann Date: Tue, 19 Mar 2019 16:46:25 +0100 Subject: 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 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]; } -- cgit v0.10.2-6-g49f6