From 2919b1af5f6686387f823668e8f8599a24840d41 Mon Sep 17 00:00:00 2001 From: Martin Gondermann Date: Sun, 3 Jul 2016 14:58:48 +0200 Subject: [PATCH] Removed option to minimize to tray, this is now the default behaviour --- CHANGELOG.md | 4 ++-- docs/setup.md | 2 -- src/browser/settings.jsx | 23 +------------------- src/main.js | 33 ++++++++++++----------------- test/specs/browser/settings_test.js | 10 --------- 5 files changed, 16 insertions(+), 56 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eabdd5d3..d3151021 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,12 +10,12 @@ #### Windows - Fixed the pixelated app icon on the top left of the window. - Fixed the blurred tray icon. -- Added Option to minimize Window to system tray on close +- The main window is now minimized to system tray on close - Added Option to toggle minimize/restore on click on system tray icon #### OS X - Fixed that two icons appear on a notification. -- Added Option to hide Window from dock on close +- The main window is now hidden from dock on close ### Improvements - Added shortcuts diff --git a/docs/setup.md b/docs/setup.md index 8e7157a9..d2d1690b 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -124,8 +124,6 @@ The Settings Page is available from the **File** menu under **Settings** (Click This option allows such images to be rendered, but please be careful for security. - **Start app on login** (Windows, Linux) - This option starts the application when you login. - - **Leave app running in notification area when the window is closed** (Windows, OS X) - - This option hides the window to the system tray, if the window is closed - **Toggle window visibility when clicking on the tray icon** (Windows) - If checked, then a click on the system tray icon leads to a toggling of the minimized/maximized state of the window diff --git a/src/browser/settings.jsx b/src/browser/settings.jsx index b1e3ed52..aecb514f 100644 --- a/src/browser/settings.jsx +++ b/src/browser/settings.jsx @@ -61,7 +61,6 @@ var SettingsPage = React.createClass({ trayIconTheme: this.state.trayIconTheme, disablewebsecurity: this.state.disablewebsecurity, version: settings.version, - minimizeToTray: this.state.minimizeToTray, toggleWindowOnTrayIconClick: this.state.toggleWindowOnTrayIconClick, notifications: { flashWindow: this.state.notifications.flashWindow @@ -106,12 +105,6 @@ var SettingsPage = React.createClass({ this.setState({ showTrayIcon: shouldShowTrayIcon }); - - if (process.platform === 'darwin' && !shouldShowTrayIcon) { - this.setState({ - minimizeToTray: false - }); - } }, handleChangeTrayIconTheme: function() { this.setState({ @@ -123,14 +116,6 @@ var SettingsPage = React.createClass({ autostart: this.refs.autostart.getChecked() }); }, - handleChangeMinimizeToTray: function() { - var shouldMinimizeToTray = (process.platform !== 'darwin' || this.refs.showTrayIcon.getChecked()) - && this.refs.minimizeToTray.getChecked(); - - this.setState({ - minimizeToTray: shouldMinimizeToTray - }); - }, handleChangeToggleWindowOnTrayIconClick: function() { this.setState({ toggleWindowOnTrayIconClick: this.refs.toggleWindowOnTrayIconClick.getChecked() @@ -179,18 +164,12 @@ var SettingsPage = React.createClass({ options.push(); } - if (process.platform === 'win32') { - options.push(); - } else if (process.platform === 'darwin') { - options.push(); - } if (process.platform === 'win32') { options.push(); } + var options_row = (options.length > 0) ? ( diff --git a/src/main.js b/src/main.js index e63aa2fa..19740b8f 100644 --- a/src/main.js +++ b/src/main.js @@ -261,12 +261,15 @@ app.on('ready', function() { trayIcon.popUpContextMenu(); }); trayIcon.on('balloon-click', function() { - if (process.platform === 'win32') { - if (config.minimizeToTray) { - mainWindow.show(); - mainWindow.isHidden = false; - } + if (process.platform === 'win32' || process.platform === 'darwin') { + mainWindow.show(); + mainWindow.isHidden = false; } + + if (process.platform === 'darwin') { + app.dock.show(); + } + mainWindow.focus(); }); ipcMain.on('notified', function(event, arg) { @@ -380,26 +383,16 @@ app.on('ready', function() { event.preventDefault(); switch (process.platform) { case 'win32': - if (config.minimizeToTray) { - mainWindow.hide(); - mainWindow.isHidden = true; - } - else { - mainWindow.minimize(); - } + mainWindow.hide(); + mainWindow.isHidden = true; break; case 'linux': mainWindow.minimize(); break; case 'darwin': - if (config.minimizeToTray) { - mainWindow.hide(); - app.dock.hide(); - mainWindow.isHidden = true; - } - else { - mainWindow.minimize(); - } + mainWindow.hide(); + app.dock.hide(); + mainWindow.isHidden = true; break; default: } diff --git a/test/specs/browser/settings_test.js b/test/specs/browser/settings_test.js index 14aa7f73..3cfff628 100644 --- a/test/specs/browser/settings_test.js +++ b/test/specs/browser/settings_test.js @@ -151,16 +151,6 @@ describe('browser/settings.html', function() { }); }); - describe('Minimize to tray', function() { - it('should appear on win32 and darwin', function() { - const expected = (process.platform === 'win32' || process.platform === 'darwin'); - env.addClientCommands(this.app.client); - return this.app.client - .loadSettingsPage() - .isExisting('#inputMinimizeToTray').should.eventually.equal(expected) - }); - }); - describe('Toggle window visibility when clicking on the tray icon', function() { it('should appear on win32', function() { const expected = (process.platform === 'win32');