Bug 1434584 - Make icon in MacOS nsStandaloneNativeMenu a template image. r=mstange, a=RyanVM
authorJohann Hofmann <jhofmann@mozilla.com>
Fri, 30 Mar 2018 20:33:42 +0200
changeset 463053 82edf3649c7cbe815ee95e156297213044ccb4b2
parent 463052 9a2a113d5cfe8fc259b24aa3b1fa900709d2ca1b
child 463054 c2e7a6fff7529d97036fe96b2c5d4cbd42f78590
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange, RyanVM
bugs1434584
milestone60.0
Bug 1434584 - Make icon in MacOS nsStandaloneNativeMenu a template image. r=mstange, a=RyanVM MozReview-Commit-ID: G0s0rUyiKMx
widget/cocoa/nsStandaloneNativeMenu.mm
--- a/widget/cocoa/nsStandaloneNativeMenu.mm
+++ b/widget/cocoa/nsStandaloneNativeMenu.mm
@@ -196,17 +196,21 @@ nsStandaloneNativeMenu::ForceUpdateNativ
 
   return NS_OK;
 }
 
 void
 nsStandaloneNativeMenu::IconUpdated()
 {
   if (mContainerStatusBarItem) {
-    [mContainerStatusBarItem setImage:[mMenu->NativeMenuItem() image]];
+    NSImage* menuImage = [mMenu->NativeMenuItem() image];
+    if (menuImage) {
+      [menuImage setTemplate:true];
+    }
+    [mContainerStatusBarItem setImage:menuImage];
   }
 }
 
 void
 nsStandaloneNativeMenu::SetContainerStatusBarItem(NSStatusItem* aItem)
 {
   mContainerStatusBarItem = aItem;
   IconUpdated();