From a51b2cd333acb0f64bc33b40551c06010b170189 Mon Sep 17 00:00:00 2001 From: Xinto Date: Fri, 22 Sep 2023 23:09:55 +0400 Subject: [PATCH] optimize the menu bar for macOS --- .gitignore | 2 ++ src/main/mainWindow.ts | 23 +++++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 6ee3e11..683ca39 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ dist node_modules .env +.DS_Store +.idea/ \ No newline at end of file diff --git a/src/main/mainWindow.ts b/src/main/mainWindow.ts index aab75de..313982d 100644 --- a/src/main/mainWindow.ts +++ b/src/main/mainWindow.ts @@ -28,6 +28,7 @@ import { Settings, VencordSettings } from "./settings"; import { createSplashWindow } from "./splash"; import { makeLinksOpenExternally } from "./utils/makeLinksOpenExternally"; import { downloadVencordFiles, ensureVencordFiles } from "./utils/vencordLoader"; +import { SettingsRouter } from "@vencord/types/webpack/common"; let isQuitting = false; let tray: Tray; @@ -182,13 +183,31 @@ function initMenuBar(win: BrowserWindow) { } }, isDarwin && { - label: "Hide", + type: "separator" + }, + isDarwin && { + label: "Settings", + accelerator: "CmdOrCtrl+,", + async click() { + mainWin.webContents.executeJavaScript("Vencord.Webpack.Common.SettingsRouter.open()") + } + }, + isDarwin && { + type: "separator" + }, + isDarwin && { + label: "Hide Vesktop", role: "hide" }, isDarwin && { - label: "Hide others", role: "hideOthers" }, + isDarwin && { + role: "unhide", + }, + isDarwin && { + type: "separator" + }, { label: "Quit", accelerator: wantCtrlQ ? "CmdOrCtrl+Q" : void 0,