Bug 1434584 - Make icon in MacOS nsStandaloneNativeMenu a template image. r=mstange
authorJohann Hofmann <jhofmann@mozilla.com>
Fri, 30 Mar 2018 20:33:42 +0200
changeset 467408 bacd19ec0d4b81a51049faa28faddc2e4a35b3c2
parent 467407 2cd639e2998fbd04fb2a1a5a3022cf98b87b6f0d
child 467409 60e7fca839b4767cb04dd500a0d4229447213248
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1434584
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1434584 - Make icon in MacOS nsStandaloneNativeMenu a template image. r=mstange 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();