From cb226d2a6f05a339e9020bed6ad6fc92ef96333c Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Tue, 5 Jan 2016 11:25:36 -0800 Subject: [PATCH] fix(icon): Use app icon on win32, use correct path on Linux --- src/browser/nylas-window.coffee | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/browser/nylas-window.coffee b/src/browser/nylas-window.coffee index 9f6ca9753..fcd7fa88f 100644 --- a/src/browser/nylas-window.coffee +++ b/src/browser/nylas-window.coffee @@ -5,11 +5,12 @@ url = require 'url' _ = require 'underscore' {EventEmitter} = require 'events' +WindowIconPath = null + module.exports = class NylasWindow _.extend @prototype, EventEmitter.prototype - @iconPath: path.resolve(__dirname, '..', '..', 'build', 'resources', 'nylas.png') @includeShellLoadTime: true browserWindow: null @@ -58,7 +59,6 @@ class NylasWindow width: width height: height resizable: resizable ? true - icon: @constructor.iconPath webPreferences: directWrite: true @@ -70,7 +70,11 @@ class NylasWindow # Don't set icon on Windows so the exe's ico will be used as window and # taskbar's icon. See https://github.com/atom/atom/issues/4811 for more. if process.platform is 'linux' - options.icon = @constructor.iconPath + unless WindowIconPath + WindowIconPath = path.resolve(__dirname, '..', '..', 'nylas.png') + unless fs.existsSync(WindowIconPath) + WindowIconPath = path.resolve(__dirname, '..', '..', 'build', 'resources', 'nylas.png') + options.icon = WindowIconPath @browserWindow = new BrowserWindow(options) global.application.windowManager.addWindow(this)