Remove deprecated features

- Hide menu bar (Windows, Linux)
- Toggle window visility when clicking on the tray icon (Windows)
- Minimize to tray (Mac)
This commit is contained in:
Yuya Ochiai
2017-02-10 21:33:52 +09:00
parent 62488e62b9
commit 035800387b
3 changed files with 0 additions and 33 deletions

View File

@@ -61,13 +61,11 @@ const SettingsPage = React.createClass({
handleSave() {
var config = {
teams: this.state.teams,
hideMenuBar: this.state.hideMenuBar,
showTrayIcon: this.state.showTrayIcon,
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
},
@@ -75,10 +73,6 @@ const SettingsPage = React.createClass({
};
settings.writeFileSync(this.props.configFile, config);
if (process.platform === 'win32' || process.platform === 'linux') {
var currentWindow = remote.getCurrentWindow();
currentWindow.setAutoHideMenuBar(config.hideMenuBar);
currentWindow.setMenuBarVisibility(!config.hideMenuBar);
var autostart = this.state.autostart;
appLauncher.isEnabled().then((enabled) => {
if (enabled && !autostart) {
@@ -102,11 +96,6 @@ const SettingsPage = React.createClass({
disablewebsecurity: this.refs.disablewebsecurity.props.checked
});
},
handleChangeHideMenuBar() {
this.setState({
hideMenuBar: !this.refs.hideMenuBar.props.checked
});
},
handleChangeShowTrayIcon() {
var shouldShowTrayIcon = !this.refs.showTrayIcon.props.checked;
this.setState({
@@ -136,11 +125,6 @@ const SettingsPage = React.createClass({
minimizeToTray: shouldMinimizeToTray
});
},
handleChangeToggleWindowOnTrayIconClick() {
this.setState({
toggleWindowOnTrayIconClick: !this.refs.toggleWindowOnTrayIconClick.props.checked
});
},
toggleShowTeamForm() {
this.setState({
showAddTeamForm: !this.state.showAddTeamForm

View File

@@ -16,12 +16,10 @@ function loadDefault(version) {
case 1:
return {
teams: [],
hideMenuBar: false,
showTrayIcon: false,
trayIconTheme: 'light',
disablewebsecurity: true,
minimizeToTray: false,
toggleWindowOnTrayIconClick: false,
version: 1,
notifications: {
flashWindow: 0 // 0 = flash never, 1 = only when idle (after 10 seconds), 2 = always

View File

@@ -254,16 +254,6 @@ app.on('window-all-closed', () => {
}
});
// For win32, auto-hide menu bar.
app.on('browser-window-created', (event, window) => {
if (process.platform === 'win32' || process.platform === 'linux') {
if (config.hideMenuBar) {
window.setAutoHideMenuBar(true);
window.setMenuBarVisibility(false);
}
}
});
// For OSX, show hidden mainWindow when clicking dock icon.
app.on('activate', () => {
mainWindow.show();
@@ -366,8 +356,6 @@ app.on('ready', () => {
if (process.platform === 'darwin') {
app.dock.show();
}
} else if ((process.platform === 'win32') && config.toggleWindowOnTrayIconClick) {
mainWindow.minimize();
} else {
mainWindow.focus();
}
@@ -561,9 +549,6 @@ app.on('ready', () => {
break;
case 'darwin':
hideWindow(mainWindow);
if (config.minimizeToTray) {
app.dock.hide();
}
break;
default:
}