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:
@@ -61,13 +61,11 @@ const SettingsPage = React.createClass({
|
|||||||
handleSave() {
|
handleSave() {
|
||||||
var config = {
|
var config = {
|
||||||
teams: this.state.teams,
|
teams: this.state.teams,
|
||||||
hideMenuBar: this.state.hideMenuBar,
|
|
||||||
showTrayIcon: this.state.showTrayIcon,
|
showTrayIcon: this.state.showTrayIcon,
|
||||||
trayIconTheme: this.state.trayIconTheme,
|
trayIconTheme: this.state.trayIconTheme,
|
||||||
disablewebsecurity: this.state.disablewebsecurity,
|
disablewebsecurity: this.state.disablewebsecurity,
|
||||||
version: settings.version,
|
version: settings.version,
|
||||||
minimizeToTray: this.state.minimizeToTray,
|
minimizeToTray: this.state.minimizeToTray,
|
||||||
toggleWindowOnTrayIconClick: this.state.toggleWindowOnTrayIconClick,
|
|
||||||
notifications: {
|
notifications: {
|
||||||
flashWindow: this.state.notifications.flashWindow
|
flashWindow: this.state.notifications.flashWindow
|
||||||
},
|
},
|
||||||
@@ -75,10 +73,6 @@ const SettingsPage = React.createClass({
|
|||||||
};
|
};
|
||||||
settings.writeFileSync(this.props.configFile, config);
|
settings.writeFileSync(this.props.configFile, config);
|
||||||
if (process.platform === 'win32' || process.platform === 'linux') {
|
if (process.platform === 'win32' || process.platform === 'linux') {
|
||||||
var currentWindow = remote.getCurrentWindow();
|
|
||||||
currentWindow.setAutoHideMenuBar(config.hideMenuBar);
|
|
||||||
currentWindow.setMenuBarVisibility(!config.hideMenuBar);
|
|
||||||
|
|
||||||
var autostart = this.state.autostart;
|
var autostart = this.state.autostart;
|
||||||
appLauncher.isEnabled().then((enabled) => {
|
appLauncher.isEnabled().then((enabled) => {
|
||||||
if (enabled && !autostart) {
|
if (enabled && !autostart) {
|
||||||
@@ -102,11 +96,6 @@ const SettingsPage = React.createClass({
|
|||||||
disablewebsecurity: this.refs.disablewebsecurity.props.checked
|
disablewebsecurity: this.refs.disablewebsecurity.props.checked
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleChangeHideMenuBar() {
|
|
||||||
this.setState({
|
|
||||||
hideMenuBar: !this.refs.hideMenuBar.props.checked
|
|
||||||
});
|
|
||||||
},
|
|
||||||
handleChangeShowTrayIcon() {
|
handleChangeShowTrayIcon() {
|
||||||
var shouldShowTrayIcon = !this.refs.showTrayIcon.props.checked;
|
var shouldShowTrayIcon = !this.refs.showTrayIcon.props.checked;
|
||||||
this.setState({
|
this.setState({
|
||||||
@@ -136,11 +125,6 @@ const SettingsPage = React.createClass({
|
|||||||
minimizeToTray: shouldMinimizeToTray
|
minimizeToTray: shouldMinimizeToTray
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleChangeToggleWindowOnTrayIconClick() {
|
|
||||||
this.setState({
|
|
||||||
toggleWindowOnTrayIconClick: !this.refs.toggleWindowOnTrayIconClick.props.checked
|
|
||||||
});
|
|
||||||
},
|
|
||||||
toggleShowTeamForm() {
|
toggleShowTeamForm() {
|
||||||
this.setState({
|
this.setState({
|
||||||
showAddTeamForm: !this.state.showAddTeamForm
|
showAddTeamForm: !this.state.showAddTeamForm
|
||||||
|
@@ -16,12 +16,10 @@ function loadDefault(version) {
|
|||||||
case 1:
|
case 1:
|
||||||
return {
|
return {
|
||||||
teams: [],
|
teams: [],
|
||||||
hideMenuBar: false,
|
|
||||||
showTrayIcon: false,
|
showTrayIcon: false,
|
||||||
trayIconTheme: 'light',
|
trayIconTheme: 'light',
|
||||||
disablewebsecurity: true,
|
disablewebsecurity: true,
|
||||||
minimizeToTray: false,
|
minimizeToTray: false,
|
||||||
toggleWindowOnTrayIconClick: false,
|
|
||||||
version: 1,
|
version: 1,
|
||||||
notifications: {
|
notifications: {
|
||||||
flashWindow: 0 // 0 = flash never, 1 = only when idle (after 10 seconds), 2 = always
|
flashWindow: 0 // 0 = flash never, 1 = only when idle (after 10 seconds), 2 = always
|
||||||
|
15
src/main.js
15
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.
|
// For OSX, show hidden mainWindow when clicking dock icon.
|
||||||
app.on('activate', () => {
|
app.on('activate', () => {
|
||||||
mainWindow.show();
|
mainWindow.show();
|
||||||
@@ -366,8 +356,6 @@ app.on('ready', () => {
|
|||||||
if (process.platform === 'darwin') {
|
if (process.platform === 'darwin') {
|
||||||
app.dock.show();
|
app.dock.show();
|
||||||
}
|
}
|
||||||
} else if ((process.platform === 'win32') && config.toggleWindowOnTrayIconClick) {
|
|
||||||
mainWindow.minimize();
|
|
||||||
} else {
|
} else {
|
||||||
mainWindow.focus();
|
mainWindow.focus();
|
||||||
}
|
}
|
||||||
@@ -561,9 +549,6 @@ app.on('ready', () => {
|
|||||||
break;
|
break;
|
||||||
case 'darwin':
|
case 'darwin':
|
||||||
hideWindow(mainWindow);
|
hideWindow(mainWindow);
|
||||||
if (config.minimizeToTray) {
|
|
||||||
app.dock.hide();
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user