mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-09-10 22:54:45 +08:00
Add new email shortcut on MacOS dock icon (#2452)
This commit is contained in:
parent
89047ad768
commit
b4d0df1002
1 changed files with 13 additions and 0 deletions
|
@ -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) => {
|
ipcMain.on('new-window', (event, options) => {
|
||||||
const win = options.windowKey ? this.windowManager.get(options.windowKey) : null;
|
const win = options.windowKey ? this.windowManager.get(options.windowKey) : null;
|
||||||
if (win) {
|
if (win) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue