Add Enable Menu setting

This commit is contained in:
V 2023-07-28 21:54:17 +02:00
parent 5fa9264bdb
commit 61f9559984
No known key found for this signature in database
GPG key ID: A1DC0CFB5615D905
3 changed files with 10 additions and 3 deletions

View file

@ -298,6 +298,10 @@ function initSettingsListeners(win: BrowserWindow) {
win.setBackgroundColor("#ffffff");
}
});
addSettingsListener("enableMenu", enabled => {
win.setAutoHideMenuBar(enabled ?? false);
});
}
function initSpellCheck(win: BrowserWindow) {
@ -311,7 +315,7 @@ function createMainWindow() {
removeSettingsListeners();
removeVencordSettingsListeners();
const { staticTitle, transparencyOption } = Settings.store;
const { staticTitle, transparencyOption, enableMenu } = Settings.store;
const { frameless, macosTranslucency } = VencordSettings.store;
const win = (mainWin = new BrowserWindow({
show: false,
@ -340,7 +344,8 @@ function createMainWindow() {
}
: {}),
...(process.platform === "darwin" ? { titleBarStyle: "hiddenInset" } : {}),
...getWindowBoundsOptions()
...getWindowBoundsOptions(),
autoHideMenuBar: enableMenu
}));
win.setMenuBarVisibility(false);

View file

@ -40,7 +40,8 @@ export default function SettingsUi() {
"Open Links in app (experimental)",
"Opens links in a new Vesktop window instead of your web browser"
],
["staticTitle", "Static Title", 'Makes the window title "Vencord" instead of changing to the current page']
["staticTitle", "Static Title", 'Makes the window title "Vencord" instead of changing to the current page'],
["enableMenu", "Enable Menu Bar", "Enables the application menu bar. Press ALT to toggle visibility."]
];
const switches = allSwitches.filter(isTruthy);

View file

@ -19,6 +19,7 @@ export interface Settings {
minimizeToTray?: boolean;
skippedUpdate?: string;
staticTitle?: boolean;
enableMenu?: boolean;
arRPC?: boolean;
appBadge?: boolean;