From 035800387bf9bae5c61bcf68a845a1d85a167063 Mon Sep 17 00:00:00 2001 From: Yuya Ochiai Date: Fri, 10 Feb 2017 21:33:52 +0900 Subject: [PATCH] Remove deprecated features - Hide menu bar (Windows, Linux) - Toggle window visility when clicking on the tray icon (Windows) - Minimize to tray (Mac) --- src/browser/components/SettingsPage.jsx | 16 ---------------- src/common/settings.js | 2 -- src/main.js | 15 --------------- 3 files changed, 33 deletions(-) diff --git a/src/browser/components/SettingsPage.jsx b/src/browser/components/SettingsPage.jsx index 39c1da6a..884be5b3 100644 --- a/src/browser/components/SettingsPage.jsx +++ b/src/browser/components/SettingsPage.jsx @@ -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 diff --git a/src/common/settings.js b/src/common/settings.js index 2a921dbb..cde9cc8c 100644 --- a/src/common/settings.js +++ b/src/common/settings.js @@ -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 diff --git a/src/main.js b/src/main.js index 556f5c07..f74fa7e3 100644 --- a/src/main.js +++ b/src/main.js @@ -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: }