Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2019-08-06 18:06:47 +01:00
parent 1e9881dd7d
commit 5d048972ab

View file

@ -1,5 +1,6 @@
/* /*
Copyright 2019 New Vector Ltd Copyright 2019 New Vector Ltd
Copyright 2019 Michael Telatynski <7t3chguy@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -20,8 +21,8 @@ import {SettingLevel} from "../../../../../settings/SettingsStore";
import LabelledToggleSwitch from "../../../elements/LabelledToggleSwitch"; import LabelledToggleSwitch from "../../../elements/LabelledToggleSwitch";
import SettingsStore from "../../../../../settings/SettingsStore"; import SettingsStore from "../../../../../settings/SettingsStore";
import Field from "../../../elements/Field"; import Field from "../../../elements/Field";
const sdk = require("../../../../.."); import sdk from "../../../../..";
const PlatformPeg = require("../../../../../PlatformPeg"); import PlatformPeg from "../../../../../PlatformPeg";
export default class PreferencesUserSettingsTab extends React.Component { export default class PreferencesUserSettingsTab extends React.Component {
static COMPOSER_SETTINGS = [ static COMPOSER_SETTINGS = [
@ -131,23 +132,26 @@ export default class PreferencesUserSettingsTab extends React.Component {
render() { render() {
let autoLaunchOption = null; let autoLaunchOption = null;
if (this.state.autoLaunchSupported) { if (this.state.autoLaunchSupported) {
autoLaunchOption = <LabelledToggleSwitch value={this.state.autoLaunch} autoLaunchOption = <LabelledToggleSwitch
onChange={this._onAutoLaunchChange} value={this.state.autoLaunch}
label={_t('Start automatically after system login')} />; onChange={this._onAutoLaunchChange}
label={_t('Start automatically after system login')} />;
} }
let autoHideMenuOption = null; let autoHideMenuOption = null;
if (this.state.alwaysShowMenuBarSupported) { if (this.state.alwaysShowMenuBarSupported) {
autoHideMenuOption = <LabelledToggleSwitch value={this.state.alwaysShowMenuBar} autoHideMenuOption = <LabelledToggleSwitch
onChange={this._onAlwaysShowMenuBarChange} value={this.state.alwaysShowMenuBar}
label={_t('Always show the window menu bar')} />; onChange={this._onAlwaysShowMenuBarChange}
label={_t('Always show the window menu bar')} />;
} }
let minimizeToTrayOption = null; let minimizeToTrayOption = null;
if (this.state.minimizeToTraySupported) { if (this.state.minimizeToTraySupported) {
minimizeToTrayOption = <LabelledToggleSwitch value={this.state.minimizeToTray} minimizeToTrayOption = <LabelledToggleSwitch
onChange={this._onMinimizeToTrayChange} value={this.state.minimizeToTray}
label={_t('Close button should minimize window to tray')} />; onChange={this._onMinimizeToTrayChange}
label={_t('Close button should minimize window to tray')} />;
} }
return ( return (
@ -168,9 +172,12 @@ export default class PreferencesUserSettingsTab extends React.Component {
{minimizeToTrayOption} {minimizeToTrayOption}
{autoHideMenuOption} {autoHideMenuOption}
{autoLaunchOption} {autoLaunchOption}
<Field id={"autocompleteDelay"} label={_t('Autocomplete delay (ms)')} type='number' <Field
value={this.state.autocompleteDelay} id={"autocompleteDelay"}
onChange={this._onAutocompleteDelayChange} /> label={_t('Autocomplete delay (ms)')}
type='number'
value={this.state.autocompleteDelay}
onChange={this._onAutocompleteDelayChange} />
</div> </div>
</div> </div>
); );