From fa811f99de7d71d5b7e59a1a2ed7bdd3a2084131 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Wed, 30 Oct 2019 14:32:27 +0000
Subject: [PATCH] Merge hide-to-tray-icon with show-tray-icon
---
src/BasePlatform.js | 12 -------
.../tabs/user/PreferencesUserSettingsTab.js | 31 ++-----------------
src/i18n/strings/en_EN.json | 3 +-
3 files changed, 3 insertions(+), 43 deletions(-)
diff --git a/src/BasePlatform.js b/src/BasePlatform.js
index 727a9cce93..a97c14bf90 100644
--- a/src/BasePlatform.js
+++ b/src/BasePlatform.js
@@ -140,18 +140,6 @@ export default class BasePlatform {
throw new Error("Unimplemented");
}
- supportsTrayIcon(): boolean {
- return false;
- }
-
- async getTrayIconEnabled(): boolean {
- return false;
- }
-
- async setTrayIconEnabled(enabled: boolean): void {
- throw new Error("Unimplemented");
- }
-
supportsMinimizeToTray(): boolean {
return false;
}
diff --git a/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.js b/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.js
index 1b2a4817c8..6fc854c155 100644
--- a/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.js
+++ b/src/components/views/settings/tabs/user/PreferencesUserSettingsTab.js
@@ -69,8 +69,6 @@ export default class PreferencesUserSettingsTab extends React.Component {
autoLaunchSupported: false,
alwaysShowMenuBar: true,
alwaysShowMenuBarSupported: false,
- showTrayIcon: false,
- showTrayIconSupported: false,
minimizeToTray: true,
minimizeToTraySupported: false,
autocompleteDelay:
@@ -97,12 +95,6 @@ export default class PreferencesUserSettingsTab extends React.Component {
alwaysShowMenuBar = !await platform.getAutoHideMenuBarEnabled();
}
- const showTrayIconSupported = await platform.supportsTrayIcon();
- let showTrayIcon = true;
- if (showTrayIconSupported) {
- showTrayIcon = await platform.getTrayIconEnabled();
- }
-
const minimizeToTraySupported = await platform.supportsMinimizeToTray();
let minimizeToTray = true;
if (minimizeToTraySupported) {
@@ -114,8 +106,6 @@ export default class PreferencesUserSettingsTab extends React.Component {
autoLaunchSupported,
alwaysShowMenuBarSupported,
alwaysShowMenuBar,
- showTrayIconSupported,
- showTrayIcon,
minimizeToTraySupported,
minimizeToTray,
});
@@ -129,10 +119,6 @@ export default class PreferencesUserSettingsTab extends React.Component {
PlatformPeg.get().setAutoHideMenuBarEnabled(!checked).then(() => this.setState({alwaysShowMenuBar: checked}));
};
- _onShowTrayIconChange = (checked) => {
- PlatformPeg.get().setTrayIconEnabled(checked).then(() => this.setState({showTrayIcon: checked}));
- };
-
_onMinimizeToTrayChange = (checked) => {
PlatformPeg.get().setMinimizeToTrayEnabled(checked).then(() => this.setState({minimizeToTray: checked}));
};
@@ -174,24 +160,12 @@ export default class PreferencesUserSettingsTab extends React.Component {
label={_t('Always show the window menu bar')} />;
}
- let enableTrayIcon = null;
- if (this.state.showTrayIconSupported) {
- enableTrayIcon = ;
- }
-
let minimizeToTrayOption = null;
if (this.state.minimizeToTraySupported) {
- // If tray icon is disabled then this option is not available and forced to off.
- // Unless tray icon is not supported (darwin)
- const disableOption = this.state.showTrayIconSupported && !this.state.showTrayIcon;
minimizeToTrayOption = ;
+ label={_t('Show tray icon and minimize window to it on close')} />;
}
return (
@@ -209,7 +183,6 @@ export default class PreferencesUserSettingsTab extends React.Component {
{_t("Advanced")}
{this._renderGroup(PreferencesUserSettingsTab.ADVANCED_SETTINGS)}
- {enableTrayIcon}
{minimizeToTrayOption}
{autoHideMenuOption}
{autoLaunchOption}
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json
index 8bd563a981..524a8a1abf 100644
--- a/src/i18n/strings/en_EN.json
+++ b/src/i18n/strings/en_EN.json
@@ -640,8 +640,7 @@
"Notifications": "Notifications",
"Start automatically after system login": "Start automatically after system login",
"Always show the window menu bar": "Always show the window menu bar",
- "Show tray icon": "Show tray icon",
- "Close button should minimize window to tray": "Close button should minimize window to tray",
+ "Show tray icon and minimize window to it on close": "Show tray icon and minimize window to it on close",
"Preferences": "Preferences",
"Composer": "Composer",
"Timeline": "Timeline",