From 1494f167b800edfeb625013be955262aeac2cfd4 Mon Sep 17 00:00:00 2001 From: zhangguanyu02 Date: Thu, 24 May 2018 13:08:35 +0800 Subject: [PATCH] add: support cmd + h hide window in macos --- app/main.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/main.js b/app/main.js index 71578e4..adb110c 100644 --- a/app/main.js +++ b/app/main.js @@ -124,6 +124,16 @@ function createWindow () { ]} ]; + if (process.platform === 'darwin') { + template[0].submenu.splice( + 2, + 0, + {role: 'hide'}, + {role: 'hideothers'}, + {role: 'unhide'}, + ) + } + electron.Menu.setApplicationMenu(electron.Menu.buildFromTemplate(template)); initialTray(mainWindow);