Fixes a bug on the settings pane which rendered the notification theme icon as a checkbox

This commit is contained in:
Jonas Schwabe
2016-12-10 20:27:09 +01:00
parent 89e3a52ef2
commit d4f3ca23d3

View File

@@ -1,5 +1,6 @@
const React = require('react'); const React = require('react');
const {Button, Checkbox, Col, FormGroup, Grid, Navbar, Row} = require('react-bootstrap'); const ReactDOM = require('react-dom');
const {Button, Checkbox, Col, FormGroup, FormControl, ControlLabel, Grid, Navbar, Row} = require('react-bootstrap');
const {ipcRenderer, remote} = require('electron'); const {ipcRenderer, remote} = require('electron');
const AutoLaunch = require('auto-launch'); const AutoLaunch = require('auto-launch');
@@ -114,7 +115,7 @@ const SettingsPage = React.createClass({
}, },
handleChangeTrayIconTheme() { handleChangeTrayIconTheme() {
this.setState({ this.setState({
trayIconTheme: !this.refs.trayIconTheme.props.checked trayIconTheme: ReactDOM.findDOMNode(this.refs.trayIconTheme).value
}); });
}, },
handleChangeAutoStart() { handleChangeAutoStart() {
@@ -189,16 +190,19 @@ const SettingsPage = React.createClass({
} }
if (process.platform === 'linux') { if (process.platform === 'linux') {
options.push( options.push(
<Checkbox <FormGroup>
key='inputTrayIconTheme' <ControlLabel>{'Icon theme (Need to restart the application)'}</ControlLabel>
ref='trayIconTheme' <FormControl
type='select' componentClass='select'
value={this.state.trayIconTheme} key='inputTrayIconTheme'
onChange={this.handleChangeTrayIconTheme} ref='trayIconTheme'
>{'Icon theme (Need to restart the application)'} value={this.state.trayIconTheme}
<option value='light'>{'Light'}</option> onChange={this.handleChangeTrayIconTheme}
<option value='dark'>{'Dark'}</option> >
</Checkbox>); <option value='light'>{'Light'}</option>
<option value='dark'>{'Dark'}</option>
</FormControl>
</FormGroup>);
} }
options.push( options.push(
<Checkbox <Checkbox