diff --git a/README.md b/README.md index bfbde9c..ecadb5b 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ The short list is: - [Shortcuts don't work in non-English layout](https://help.hipchat.com/forums/138883-suggestions-ideas/suggestions/4566565-non-english-layout-does-not-let-copy-paste) -- UI is not up to date compared to Web and OS X app. +- [UI is not up to date compared to Web and OS X app.](https://flowdock.uservoice.com/forums/36827-general/suggestions/5366511-add-a-linux-desktop-app) #### Why not Chromium/Firefox app diff --git a/src/scripts/browser/app-tray.js b/src/scripts/browser/app-tray.js index 94c4d36..1a2ebb7 100644 --- a/src/scripts/browser/app-tray.js +++ b/src/scripts/browser/app-tray.js @@ -27,17 +27,12 @@ class AppTray extends EventEmitter { tray.setToolTip(settings.description); tray.setContextMenu(contextMenu); tray.on('clicked', function() { - var image = 'tray.png' - tray.setImage(path.resolve(__dirname, '..', '..', 'images', image)); + global.application.markTrayClear(); global.application.onTrayClicked(); }); ipc.on('message:received', function(){ - if(global.application.mainWindow.window.isFocused()){ - return; - } - var image = 'tray-attention.png' - tray.setImage(path.resolve(__dirname, '..', '..', 'images', image)); + global.application.markTrayNeedsAtention(); }); return tray; diff --git a/src/scripts/browser/app-window.js b/src/scripts/browser/app-window.js index 3396492..c88cca4 100644 --- a/src/scripts/browser/app-window.js +++ b/src/scripts/browser/app-window.js @@ -52,6 +52,10 @@ class AppWindow extends EventEmitter { this.hide(); }); + browserWindow.on('show', function(){ + this.focus(); + }); + return browserWindow; } @@ -69,7 +73,7 @@ class AppWindow extends EventEmitter { */ show() { this.window.show(); - this.window.focus(); + this.focus(); } /** diff --git a/src/scripts/browser/application.js b/src/scripts/browser/application.js index 4c77135..55cc400 100644 --- a/src/scripts/browser/application.js +++ b/src/scripts/browser/application.js @@ -74,14 +74,25 @@ class Application extends EventEmitter { onTrayClicked() { this.toggleVisibility(); } + + markTrayNeedsAtention() { + if (this.mainWindow.window.isFocused()) { + return; + } + var image = 'tray-attention.png' + this.tray.tray.setImage(path.resolve(__dirname, '..', '..', 'images', image)); + } + markTrayClear() { + var image = 'tray.png' + this.tray.tray.setImage(path.resolve(__dirname, '..', '..', 'images', image)); + } assignEvents(menu) { // Handle application events menu.on('application:quit', ::app.quit); - menu.on('application:focus', function(){ + menu.on('application:focus', function() { global.application.mainWindow.show(); }); - menu.on('application:show-settings', function() { - }); + menu.on('application:show-settings', function() {}); menu.on('application:open-url', function(menuItem) { shell.openExternal(menuItem.url); @@ -96,13 +107,13 @@ class Application extends EventEmitter { }) .catch(::console.error); }); - menu.on('application:encrease-zoom', function(){ + menu.on('application:encrease-zoom', function() { global.application.mainWindow.window.webContents.send('zoom:encrease'); }); - menu.on('application:decrease-zoom', function(){ + menu.on('application:decrease-zoom', function() { global.application.mainWindow.window.webContents.send('zoom:decrease'); }); - menu.on('application:reset-zoom', function(){ + menu.on('application:reset-zoom', function() { global.application.mainWindow.window.webContents.send('zoom:reset'); }); // Handle window events diff --git a/tasks/pack.coffee b/tasks/pack.coffee index 2b1ba59..be6375c 100644 --- a/tasks/pack.coffee +++ b/tasks/pack.coffee @@ -29,6 +29,7 @@ manifest = require '../src/package.json' '--architecture ' + archName '--rpm-os linux' '--name ' + manifest.name + '--deb-no-default-config-files' '--force' # Overwrite existing files '--after-install ./build/resources/linux/after-install.sh' '--after-remove ./build/resources/linux/after-remove.sh' @@ -61,7 +62,7 @@ manifest = require '../src/package.json' # Package the app - async.apply cp.exec, 'fpm ' + args.join(' ') + async.apply cp.exec, 'bundle exec fpm ' + args.join(' ') ], done # Pack for all the platforms