From 0ac54f00cdae0f3c0ec13965a702a7bfb93de67d Mon Sep 17 00:00:00 2001 From: Teng-hao Chang Date: Mon, 4 May 2015 20:39:53 +0800 Subject: [PATCH] Fix tray icon on OS X 1. Supports retina tray icon with TIFF made from multiple PNGs Ref: https://github.com/nwjs/nw.js/issues/1749#issuecomment-39448326 2. Fix menubar_alert tray icon missing due to incorrect filename --- src/components/menus.js | 2 +- src/components/window-behaviour.js | 2 +- src/icons/icon_menubar.png | Bin 227 -> 0 bytes src/icons/icon_menubar.tiff | Bin 0 -> 4684 bytes src/icons/icon_menubar_alert.tiff | Bin 0 -> 4768 bytes src/icons/icon_menubar_alt.png | Bin 246 -> 0 bytes 6 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 src/icons/icon_menubar.png create mode 100644 src/icons/icon_menubar.tiff create mode 100644 src/icons/icon_menubar_alert.tiff delete mode 100644 src/icons/icon_menubar_alt.png diff --git a/src/components/menus.js b/src/components/menus.js index e5f595ca..9855f4ba 100644 --- a/src/components/menus.js +++ b/src/components/menus.js @@ -258,7 +258,7 @@ module.exports = { */ loadTrayIcon: function(win) { var tray = new gui.Tray({ - icon: 'icons/icon_' + (platform.isOSX ? 'menubar' : 'tray') + '.png' + icon: 'icons/icon_' + (platform.isOSX ? 'menubar.tiff' : 'tray.png') }); tray.on('click', function() { diff --git a/src/components/window-behaviour.js b/src/components/window-behaviour.js index bda3a583..9ea60d23 100644 --- a/src/components/window-behaviour.js +++ b/src/components/window-behaviour.js @@ -122,7 +122,7 @@ module.exports = { // Update the tray icon too if (win.tray) { - win.tray.icon = 'icons/icon_' + (platform.isOSX ? 'menubar' : 'tray') + (label ? '_alert' : '') + '.png'; + win.tray.icon = 'icons/icon_' + (platform.isOSX ? 'menubar' : 'tray') + (label ? '_alert' : '') + (platform.isOSX ? '.tiff' : '.png'); } }, 50); }, diff --git a/src/icons/icon_menubar.png b/src/icons/icon_menubar.png deleted file mode 100644 index 2637a00ef34fad52d694ed9fbd998d67df273c57..0000000000000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3vF JDf82(zXA7&p!)y- literal 0 HcmV?d00001 diff --git a/src/icons/icon_menubar_alt.png b/src/icons/icon_menubar_alt.png deleted file mode 100644 index baf0df8727e0d3c19e2368abdafc7279358cd563..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 246 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H0wnYHF4+L2_IkQFhG?8WJIR)-*+IZ9{wePy ztqIH#tU(ow{tp@_N#|@9=U8deGTkGB$+G#z8jhydOANb@ZJi);(#QCNZCifb1AS$; z#0?QVT@{i&7c5ey@cD|kb#wkWr_}OVL5rj6-BsN~?=J6_>J&APH=n|h#U-tOT_vYN z;Y*CAGDjNMZN^+r#v2ohRTeu7gOW+9`SX-+gP{0_Y4Jkgu&C*&t;ucLK6TV_FJ?7