Removed option to minimize to tray, this is now the default behaviour

This commit is contained in:
Martin Gondermann 2016-07-03 14:58:48 +02:00
parent 0a289c5237
commit 2919b1af5f
5 changed files with 16 additions and 56 deletions

View file

@ -10,12 +10,12 @@
#### Windows #### Windows
- Fixed the pixelated app icon on the top left of the window. - Fixed the pixelated app icon on the top left of the window.
- Fixed the blurred tray icon. - 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 - Added Option to toggle minimize/restore on click on system tray icon
#### OS X #### OS X
- Fixed that two icons appear on a notification. - 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 ### Improvements
- Added shortcuts - Added shortcuts

View file

@ -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. This option allows such images to be rendered, but please be careful for security.
- **Start app on login** (Windows, Linux) - **Start app on login** (Windows, Linux)
- This option starts the application when you login. - 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) - **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 - If checked, then a click on the system tray icon leads to a toggling of the minimized/maximized state of the window

View file

@ -61,7 +61,6 @@ var SettingsPage = React.createClass({
trayIconTheme: this.state.trayIconTheme, trayIconTheme: this.state.trayIconTheme,
disablewebsecurity: this.state.disablewebsecurity, disablewebsecurity: this.state.disablewebsecurity,
version: settings.version, version: settings.version,
minimizeToTray: this.state.minimizeToTray,
toggleWindowOnTrayIconClick: this.state.toggleWindowOnTrayIconClick, toggleWindowOnTrayIconClick: this.state.toggleWindowOnTrayIconClick,
notifications: { notifications: {
flashWindow: this.state.notifications.flashWindow flashWindow: this.state.notifications.flashWindow
@ -106,12 +105,6 @@ var SettingsPage = React.createClass({
this.setState({ this.setState({
showTrayIcon: shouldShowTrayIcon showTrayIcon: shouldShowTrayIcon
}); });
if (process.platform === 'darwin' && !shouldShowTrayIcon) {
this.setState({
minimizeToTray: false
});
}
}, },
handleChangeTrayIconTheme: function() { handleChangeTrayIconTheme: function() {
this.setState({ this.setState({
@ -123,14 +116,6 @@ var SettingsPage = React.createClass({
autostart: this.refs.autostart.getChecked() 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() { handleChangeToggleWindowOnTrayIconClick: function() {
this.setState({ this.setState({
toggleWindowOnTrayIconClick: this.refs.toggleWindowOnTrayIconClick.getChecked() toggleWindowOnTrayIconClick: this.refs.toggleWindowOnTrayIconClick.getChecked()
@ -179,18 +164,12 @@ var SettingsPage = React.createClass({
options.push(<Input key="inputAutoStart" id="inputAutoStart" ref="autostart" type="checkbox" label="Start app on login." checked={ this.state.autostart } onChange={ this.handleChangeAutoStart } options.push(<Input key="inputAutoStart" id="inputAutoStart" ref="autostart" type="checkbox" label="Start app on login." checked={ this.state.autostart } onChange={ this.handleChangeAutoStart }
/>); />);
} }
if (process.platform === 'win32') {
options.push(<Input key="inputMinimizeToTray" id="inputMinimizeToTray" ref="minimizeToTray" type="checkbox" label="Leave app running in notification area when the window is closed"
checked={ this.state.minimizeToTray } onChange={ this.handleChangeMinimizeToTray } />);
} else if (process.platform === 'darwin') {
options.push(<Input key="inputMinimizeToTray" id="inputMinimizeToTray" ref="minimizeToTray" type="checkbox" label="Leave app running in notification area when the window is closed"
disabled={ !this.state.showTrayIcon } checked={ this.state.minimizeToTray } onChange={ this.handleChangeMinimizeToTray } />);
}
if (process.platform === 'win32') { if (process.platform === 'win32') {
options.push(<Input key="inputToggleWindowOnTrayIconClick" id="inputToggleWindowOnTrayIconClick" ref="toggleWindowOnTrayIconClick" type="checkbox" label="Toggle window visibility when clicking on the tray icon." options.push(<Input key="inputToggleWindowOnTrayIconClick" id="inputToggleWindowOnTrayIconClick" ref="toggleWindowOnTrayIconClick" type="checkbox" label="Toggle window visibility when clicking on the tray icon."
checked={ this.state.toggleWindowOnTrayIconClick } onChange={ this.handleChangeToggleWindowOnTrayIconClick } />); checked={ this.state.toggleWindowOnTrayIconClick } onChange={ this.handleChangeToggleWindowOnTrayIconClick } />);
} }
var options_row = (options.length > 0) ? ( var options_row = (options.length > 0) ? (
<Row> <Row>
<Col md={ 12 }> <Col md={ 12 }>

View file

@ -261,12 +261,15 @@ app.on('ready', function() {
trayIcon.popUpContextMenu(); trayIcon.popUpContextMenu();
}); });
trayIcon.on('balloon-click', function() { trayIcon.on('balloon-click', function() {
if (process.platform === 'win32') { if (process.platform === 'win32' || process.platform === 'darwin') {
if (config.minimizeToTray) {
mainWindow.show(); mainWindow.show();
mainWindow.isHidden = false; mainWindow.isHidden = false;
} }
if (process.platform === 'darwin') {
app.dock.show();
} }
mainWindow.focus(); mainWindow.focus();
}); });
ipcMain.on('notified', function(event, arg) { ipcMain.on('notified', function(event, arg) {
@ -380,26 +383,16 @@ app.on('ready', function() {
event.preventDefault(); event.preventDefault();
switch (process.platform) { switch (process.platform) {
case 'win32': case 'win32':
if (config.minimizeToTray) {
mainWindow.hide(); mainWindow.hide();
mainWindow.isHidden = true; mainWindow.isHidden = true;
}
else {
mainWindow.minimize();
}
break; break;
case 'linux': case 'linux':
mainWindow.minimize(); mainWindow.minimize();
break; break;
case 'darwin': case 'darwin':
if (config.minimizeToTray) {
mainWindow.hide(); mainWindow.hide();
app.dock.hide(); app.dock.hide();
mainWindow.isHidden = true; mainWindow.isHidden = true;
}
else {
mainWindow.minimize();
}
break; break;
default: default:
} }

View file

@ -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() { describe('Toggle window visibility when clicking on the tray icon', function() {
it('should appear on win32', function() { it('should appear on win32', function() {
const expected = (process.platform === 'win32'); const expected = (process.platform === 'win32');