From b4d0df1002a8f33cfb5da3519d7def1a939a000f Mon Sep 17 00:00:00 2001 From: David Date: Wed, 12 Apr 2023 04:49:12 +0200 Subject: [PATCH] Add new email shortcut on MacOS dock icon (#2452) --- app/src/browser/application.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/src/browser/application.ts b/app/src/browser/application.ts index 8b8f2cfc6..b3b3c0866 100644 --- a/app/src/browser/application.ts +++ b/app/src/browser/application.ts @@ -542,6 +542,19 @@ export default class Application extends EventEmitter { } }); + const dockMenu = Menu.buildFromTemplate([ + { + label: localized('Compose New Message'), + click: () => global.application.emit('application:new-message'), + }, + ]); + + app.whenReady().then(() => { + if (process.platform === 'darwin') { + app.dock.setMenu(dockMenu) + } + }) + ipcMain.on('new-window', (event, options) => { const win = options.windowKey ? this.windowManager.get(options.windowKey) : null; if (win) {