diff options
author | 2020-10-15 03:29:53 +0530 | |
---|---|---|
committer | 2020-10-14 22:59:53 +0100 | |
commit | d97c00f962757210d7ef617c40d4c4e3da37efb1 (patch) | |
tree | af1941d7abc1b59427bb40d31770437d67a7bc59 /src/electron | |
parent | Add vertical style and "Always show workspace drawer" setting (#567) (diff) | |
download | ferdium-app-d97c00f962757210d7ef617c40d4c4e3da37efb1.tar.gz ferdium-app-d97c00f962757210d7ef617c40d4c4e3da37efb1.tar.zst ferdium-app-d97c00f962757210d7ef617c40d4c4e3da37efb1.zip |
Flash TaskBar (Windows) / Bounce Dock (Mac) on New Message (#1020)
- Add a new Toggle Field for Win32 and MacOS for NotifyTaskBarOnMessage in EditSettingsForm.js
- Add notifyTaskbarOnMessage under messages Array in EditSettingsScreen.js
- Update appIndicator.js to flash Windows TaskBar or Bounce the Dock on MacOS when a new message arrives
- Update en-US.json to include settings.app.form.notifyTaskBarOnMessage string
Diffstat (limited to 'src/electron')
-rw-r--r-- | src/electron/ipc-api/appIndicator.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/electron/ipc-api/appIndicator.js b/src/electron/ipc-api/appIndicator.js index 9957ef5fc..bea8e7751 100644 --- a/src/electron/ipc-api/appIndicator.js +++ b/src/electron/ipc-api/appIndicator.js | |||
@@ -25,6 +25,19 @@ export default (params) => { | |||
25 | }); | 25 | }); |
26 | 26 | ||
27 | ipcMain.on('updateAppIndicator', (event, args) => { | 27 | ipcMain.on('updateAppIndicator', (event, args) => { |
28 | |||
29 | // Flash TaskBar for windows, bounce Dock on Mac | ||
30 | if (!app.mainWindow.isFocused()) { | ||
31 | if (params.settings.app.get('notifyTaskBarOnMessage')) { | ||
32 | if (process.platform === 'win32') { | ||
33 | app.mainWindow.flashFrame(true); | ||
34 | app.mainWindow.once('focus', () => app.mainWindow.flashFrame(false)); | ||
35 | } else if (process.platform === 'darwin') { | ||
36 | app.dock.bounce('informational'); | ||
37 | } | ||
38 | } | ||
39 | } | ||
40 | |||
28 | // Update badge | 41 | // Update badge |
29 | if (process.platform === 'darwin' | 42 | if (process.platform === 'darwin' |
30 | && typeof (args.indicator) === 'string') { | 43 | && typeof (args.indicator) === 'string') { |