From 53c0428a3abfc44d9baf169cf641794a17eb867a Mon Sep 17 00:00:00 2001 From: akashnimare Date: Thu, 2 Nov 2017 20:58:35 +0530 Subject: [PATCH 1/3] Add setting to control Windows taskbar flashing #299 --- .../js/pages/preference/badge-settings.js | 2 +- .../js/pages/preference/general-section.js | 23 ++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/app/renderer/js/pages/preference/badge-settings.js b/app/renderer/js/pages/preference/badge-settings.js index 4ac7314e6..dadca751b 100644 --- a/app/renderer/js/pages/preference/badge-settings.js +++ b/app/renderer/js/pages/preference/badge-settings.js @@ -45,7 +45,7 @@ class BadgeSettings { updateOverlayIcon(messageCount, mainWindow) { if (!mainWindow.isFocused()) { - mainWindow.flashFrame(true); + mainWindow.flashFrame(ConfigUtil.getConfigItem('flashTaskbarOnMessage')); } if (messageCount === 0) { mainWindow.setOverlayIcon(null, ''); diff --git a/app/renderer/js/pages/preference/general-section.js b/app/renderer/js/pages/preference/general-section.js index f5a59974a..d75534912 100644 --- a/app/renderer/js/pages/preference/general-section.js +++ b/app/renderer/js/pages/preference/general-section.js @@ -29,9 +29,13 @@ class GeneralSection extends BaseSection {
-
Show app unread badge
-
-
+
Show app unread badge
+
+ +
+
Flash taskbar on New message
+
+
Desktop Notification
@@ -78,6 +82,7 @@ class GeneralSection extends BaseSection { this.props.$root.innerHTML = this.template(); this.updateTrayOption(); this.updateBadgeOption(); + this.updateFlashTaskbar(); this.updateUpdateOption(); this.updateSilentOption(); this.updateSidebarOption(); @@ -113,6 +118,18 @@ class GeneralSection extends BaseSection { }); } + updateFlashTaskbar() { + this.generateSettingOption({ + $element: document.querySelector('#flash-taskbar-option .setting-control'), + value: ConfigUtil.getConfigItem('flashTaskbarOnMessage', true), + clickHandler: () => { + const newValue = !ConfigUtil.getConfigItem('flashTaskbarOnMessage'); + ConfigUtil.setConfigItem('flashTaskbarOnMessage', newValue); + this.updateFlashTaskbar(); + } + }); + } + updateUpdateOption() { this.generateSettingOption({ $element: document.querySelector('#betaupdate-option .setting-control'), From 4b895a2312f918c95332bf26892174683884477e Mon Sep 17 00:00:00 2001 From: akashnimare Date: Thu, 2 Nov 2017 23:54:38 +0530 Subject: [PATCH 2/3] Don't show flash taskbar setting on Linux/macOS --- app/renderer/js/pages/preference/general-section.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/renderer/js/pages/preference/general-section.js b/app/renderer/js/pages/preference/general-section.js index d75534912..c735af06f 100644 --- a/app/renderer/js/pages/preference/general-section.js +++ b/app/renderer/js/pages/preference/general-section.js @@ -32,7 +32,7 @@ class GeneralSection extends BaseSection {
Show app unread badge
-
+
Flash taskbar on New message
@@ -82,14 +82,19 @@ class GeneralSection extends BaseSection { this.props.$root.innerHTML = this.template(); this.updateTrayOption(); this.updateBadgeOption(); - this.updateFlashTaskbar(); - this.updateUpdateOption(); this.updateSilentOption(); + this.updateUpdateOption(); this.updateSidebarOption(); this.updateStartAtLoginOption(); this.updateResetDataOption(); this.showDesktopNotification(); this.enableSpellchecker(); + + // Platform specific settings + // Flashing taskbar on Windows + if (process.platform === 'win32') { + this.updateFlashTaskbar(); + } } updateTrayOption() { From 4578d4a5f7e3731b7de9982f0698957075ea7b59 Mon Sep 17 00:00:00 2001 From: akashnimare Date: Fri, 3 Nov 2017 00:06:34 +0530 Subject: [PATCH 3/3] typo in setting --- app/renderer/js/pages/preference/general-section.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/renderer/js/pages/preference/general-section.js b/app/renderer/js/pages/preference/general-section.js index c735af06f..425e3840d 100644 --- a/app/renderer/js/pages/preference/general-section.js +++ b/app/renderer/js/pages/preference/general-section.js @@ -33,7 +33,7 @@ class GeneralSection extends BaseSection {
-
Flash taskbar on New message
+
Flash taskbar on new message