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