group darwin-specific menus
This commit is contained in:
parent
376866bb17
commit
7d8b346985
1 changed files with 30 additions and 26 deletions
|
@ -147,6 +147,8 @@ async function clearData(win: BrowserWindow) {
|
||||||
app.quit();
|
app.quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type MenuItemList = Array<MenuItemConstructorOptions | false>;
|
||||||
|
|
||||||
function initMenuBar(win: BrowserWindow) {
|
function initMenuBar(win: BrowserWindow) {
|
||||||
const isWindows = process.platform === "win32";
|
const isWindows = process.platform === "win32";
|
||||||
const isDarwin = process.platform === "darwin";
|
const isDarwin = process.platform === "darwin";
|
||||||
|
@ -181,32 +183,34 @@ function initMenuBar(win: BrowserWindow) {
|
||||||
app.quit();
|
app.quit();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isDarwin && {
|
...(!isDarwin ? [] : [
|
||||||
type: "separator"
|
{
|
||||||
},
|
type: "separator"
|
||||||
isDarwin && {
|
},
|
||||||
label: "Settings",
|
{
|
||||||
accelerator: "CmdOrCtrl+,",
|
label: "Settings",
|
||||||
async click() {
|
accelerator: "CmdOrCtrl+,",
|
||||||
mainWin.webContents.executeJavaScript("Vencord.Webpack.Common.SettingsRouter.open()")
|
async click() {
|
||||||
|
mainWin.webContents.executeJavaScript("Vencord.Webpack.Common.SettingsRouter.open()")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "separator"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Hide Vesktop", //Should probably remove the label, but it says "Hide VencordDesktop" instead of "Hide Vesktop"
|
||||||
|
role: "hide"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
role: "hideOthers"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
role: "unhide",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "separator"
|
||||||
}
|
}
|
||||||
},
|
] satisfies MenuItemList),
|
||||||
isDarwin && {
|
|
||||||
type: "separator"
|
|
||||||
},
|
|
||||||
isDarwin && {
|
|
||||||
label: "Hide Vesktop", //Should probably remove the label, but it says "Hide VencordDesktop" instead of "Hide Vesktop"
|
|
||||||
role: "hide"
|
|
||||||
},
|
|
||||||
isDarwin && {
|
|
||||||
role: "hideOthers"
|
|
||||||
},
|
|
||||||
isDarwin && {
|
|
||||||
role: "unhide",
|
|
||||||
},
|
|
||||||
isDarwin && {
|
|
||||||
type: "separator"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: "Quit",
|
label: "Quit",
|
||||||
accelerator: wantCtrlQ ? "CmdOrCtrl+Q" : void 0,
|
accelerator: wantCtrlQ ? "CmdOrCtrl+Q" : void 0,
|
||||||
|
@ -231,7 +235,7 @@ function initMenuBar(win: BrowserWindow) {
|
||||||
role: "zoomIn",
|
role: "zoomIn",
|
||||||
visible: false
|
visible: false
|
||||||
}
|
}
|
||||||
] satisfies Array<MenuItemConstructorOptions | false>;
|
] satisfies MenuItemList;
|
||||||
|
|
||||||
const menu = Menu.buildFromTemplate([
|
const menu = Menu.buildFromTemplate([
|
||||||
{
|
{
|
||||||
|
|
Reference in a new issue