From d15b045ff108fb7f9ba7c27f0c9442a6e159604a Mon Sep 17 00:00:00 2001 From: Mahadevan Sreenivasan Date: Wed, 22 Apr 2020 13:44:26 +0530 Subject: Differentiate badge icon/color for indirect notifications (#590) * feat: Differentiate between indirect and direct notifications - Windows - Replace the icon used for showing indirect notifications in the taskbar to a blue(#0088cc) color (like slack, google chat etd) - All Platforms - Replace the red color used for indirect notifications in tabbed view for a service to #0088cc (Blue) color * Indirect notification icons in tray and tabs Co-authored-by: Feiko Joosten Co-authored-by: Sampath Kumar Krishnan --- src/lib/Tray.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/lib/Tray.js') diff --git a/src/lib/Tray.js b/src/lib/Tray.js index 3700cca27..8928c97bc 100644 --- a/src/lib/Tray.js +++ b/src/lib/Tray.js @@ -6,6 +6,7 @@ import path from 'path'; const FILE_EXTENSION = process.platform === 'win32' ? 'ico' : 'png'; const INDICATOR_TRAY_PLAIN = 'tray'; const INDICATOR_TRAY_UNREAD = 'tray-unread'; +const INDICATOR_TRAY_INDIRECT = 'tray-indirect'; export default class TrayIcon { trayIcon = null; @@ -103,14 +104,23 @@ export default class TrayIcon { this._refreshIcon(); } + _getAssetFromIndicator(indicator) { + if (indicator === '•') { + return INDICATOR_TRAY_INDIRECT; + } if (indicator !== 0) { + return INDICATOR_TRAY_UNREAD; + } + return INDICATOR_TRAY_PLAIN; + } + _refreshIcon() { if (!this.trayIcon) return; - this.trayIcon.setImage(this._getAsset('tray', this.indicator !== 0 ? INDICATOR_TRAY_UNREAD : INDICATOR_TRAY_PLAIN)); + this.trayIcon.setImage(this._getAsset('tray', this._getAssetFromIndicator(this.indicator))); if (process.platform === 'darwin') { this.trayIcon.setPressedImage( - this._getAsset('tray', `${this.indicator !== 0 ? INDICATOR_TRAY_UNREAD : INDICATOR_TRAY_PLAIN}-active`), + this._getAsset('tray', `${this._getAssetFromIndicator(this.indicator)}-active`), ); } } -- cgit v1.2.3-54-g00ecf