Make the Window menu on macOS more standard (#1724)

This commit is contained in:
Wes Campaigne
2021-09-09 09:08:20 -04:00
committed by GitHub
parent cfc0613d0f
commit 07299fb2bd

View File

@@ -198,12 +198,16 @@ function createTemplate(config: Config) {
const teams = config.data?.teams || [];
const windowMenu = {
label: '&Window',
role: isMac ? 'windowMenu' : null,
submenu: [{
role: 'minimize',
// empty string removes shortcut on Windows; null will default by OS
accelerator: process.platform === 'win32' ? '' : null,
}, {
}, ...(isMac ? [{
role: 'zoom',
}, separatorItem,
] : []), {
role: 'close',
accelerator: 'CmdOrCtrl+W',
}, separatorItem, ...teams.slice(0, 9).sort((teamA, teamB) => teamA.order - teamB.order).map((team, i) => {
@@ -241,7 +245,10 @@ function createTemplate(config: Config) {
WindowManager.selectPreviousTab();
},
enabled: (teams.length > 1),
}],
}, ...(isMac ? [separatorItem, {
role: 'front',
}] : []),
],
};
template.push(windowMenu);
const submenu = [];