Make the tray icon to be optional

This commit is contained in:
Yuya Ochiai
2016-04-11 21:51:24 +09:00
parent f027008bd1
commit 8883ce3229
3 changed files with 24 additions and 2 deletions

View File

@@ -30,7 +30,8 @@ var SettingsPage = React.createClass({
}
return {
teams: config.teams,
hideMenuBar: config.hideMenuBar
hideMenuBar: config.hideMenuBar,
showTrayIcon: config.showTrayIcon
};
},
handleTeamsChange: function(teams) {
@@ -42,6 +43,7 @@ var SettingsPage = React.createClass({
var config = {
teams: this.state.teams,
hideMenuBar: this.state.hideMenuBar,
showTrayIcon: this.state.showTrayIcon,
version: settings.version
};
settings.writeFileSync(this.props.configFile, config);
@@ -60,6 +62,11 @@ var SettingsPage = React.createClass({
hideMenuBar: this.refs.hideMenuBar.getChecked()
});
},
handleChangeShowTrayIcon: function() {
this.setState({
showTrayIcon: this.refs.showTrayIcon.getChecked()
});
},
render: function() {
var teams_row = (
<Row>
@@ -74,6 +81,10 @@ var SettingsPage = React.createClass({
if (process.platform === 'win32' || process.platform === 'linux') {
options.push(<Input ref="hideMenuBar" type="checkbox" label="Hide Menu Bar (Press Alt to show Menu Bar)" checked={ this.state.hideMenuBar } onChange={ this.handleChangeHideMenuBar } />);
}
if (process.platform === 'darwin') {
options.push(<Input ref="showTrayIcon" type="checkbox" label="Show Icon on Menu Bar (Need to restart the application)" checked={ this.state.showTrayIcon } onChange={ this.handleChangeShowTrayIcon }
/>);
}
var options_row = (options.length > 0) ? (
<Row>
<Col md={ 12 }>