Add new email shortcut on MacOS dock icon (#2452)

This commit is contained in:
David 2023-04-12 04:49:12 +02:00 committed by GitHub
parent 89047ad768
commit b4d0df1002
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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) {