From 09ce424b304f3fef77ba50ede6190e97e351bad2 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Mon, 24 Aug 2026 14:14:39 +0200 Subject: [PATCH] rework Custom Titlebar setting -> Native Titlebar --- src/main/mainWindow.ts | 12 ++++++------ src/renderer/components/settings/Settings.tsx | 16 ++++++++-------- src/shared/settings.d.ts | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/main/mainWindow.ts b/src/main/mainWindow.ts index a8323f8..9f5ff60 100644 --- a/src/main/mainWindow.ts +++ b/src/main/mainWindow.ts @@ -337,14 +337,14 @@ function buildBrowserWindowOptions(): BrowserWindowConstructorOptions { enableMenu, enableShadow, enableRoundedCorners, - customTitleBar, + nativeTitleBar, splashTheming, splashBackground } = Settings.store; - const { frameless, transparent, macosVibrancyStyle } = VencordSettings.store; + const { transparent, macosVibrancyStyle } = VencordSettings.store; - const noFrame = frameless === true || customTitleBar === true; + const frameless = nativeTitleBar !== true; const backgroundColor = splashTheming !== false ? splashBackground : nativeTheme.shouldUseDarkColors ? "#313338" : "#ffffff"; @@ -361,7 +361,7 @@ function buildBrowserWindowOptions(): BrowserWindowConstructorOptions { // disable renderer backgrounding to prevent the app from unloading when in the background backgroundThrottling: false }, - frame: !noFrame, + frame: !frameless, autoHideMenuBar: enableMenu, hasShadow: enableShadow !== false, roundedCorners: enableRoundedCorners !== false, @@ -377,7 +377,7 @@ function buildBrowserWindowOptions(): BrowserWindowConstructorOptions { options.backgroundColor = "#00000000"; options.backgroundMaterial = transparencyOption; - if (customTitleBar) { + if (frameless) { options.transparent = true; } } @@ -407,7 +407,7 @@ function createMainWindow() { const win = (mainWin = new BrowserWindow(buildBrowserWindowOptions())); win.setMenuBarVisibility(false); - if (process.platform === "darwin" && Settings.store.customTitleBar) win.setWindowButtonVisibility(false); + if (process.platform === "darwin" && Settings.store.nativeTitleBar) win.setWindowButtonVisibility(false); win.on("close", e => { const useTray = !isDeckGameMode && Settings.store.minimizeToTray !== false && Settings.store.tray !== false; diff --git a/src/renderer/components/settings/Settings.tsx b/src/renderer/components/settings/Settings.tsx index add6698..d509c38 100644 --- a/src/renderer/components/settings/Settings.tsx +++ b/src/renderer/components/settings/Settings.tsx @@ -11,7 +11,7 @@ import { BaseText, Divider, ErrorBoundary } from "@vencord/types/components"; import { ComponentType } from "react"; import { WebRTCIPHandlingPolicyPicker } from "renderer/components/settings/WebRTCIPHandlingPolicyPicker"; import { Settings, useSettings } from "renderer/settings"; -import { isMac, isWindows } from "renderer/utils"; +import { isMac } from "renderer/utils"; import { AutoStartToggle } from "./AutoStartToggle"; import { DeveloperOptionsButton } from "./DeveloperOptions"; @@ -56,10 +56,10 @@ const SettingsOptions: Record> ], "User Interface": [ { - key: "customTitleBar", - title: "Discord Titlebar", - description: "Use Discord's custom title bar instead of the native system one. Requires a full restart.", - defaultValue: isWindows + key: "nativeTitleBar", + title: "Native Titlebar", + description: "Enable the system titlebar in addition to Discord's custom one. Requires a full restart.", + defaultValue: false }, { key: "staticTitle", @@ -72,21 +72,21 @@ const SettingsOptions: Record> title: "Enable Menu Bar", description: "Enables the application menu bar. Press ALT to toggle visibility.", defaultValue: false, - disabled: () => Settings.store.customTitleBar ?? isWindows + disabled: () => Settings.store.nativeTitleBar !== true }, { key: "enableShadow", title: "Enable Window Shadow", description: "Enables the window shadow. Requires a full restart.", defaultValue: true, - disabled: () => Settings.store.customTitleBar !== true + disabled: () => Settings.store.nativeTitleBar === true }, { key: "enableRoundedCorners", title: "Enable Rounded Corners", description: "Enables rounded corners. Requires a full restart.", defaultValue: true, - disabled: () => Settings.store.customTitleBar !== true + disabled: () => Settings.store.nativeTitleBar === true }, { key: "enableSplashScreen", diff --git a/src/shared/settings.d.ts b/src/shared/settings.d.ts index 9eb1045..3533e45 100644 --- a/src/shared/settings.d.ts +++ b/src/shared/settings.d.ts @@ -30,7 +30,7 @@ export interface Settings { enableTaskbarFlashing?: boolean; disableMinSize?: boolean; clickTrayToShowHide?: boolean; - customTitleBar?: boolean; + nativeTitleBar?: boolean; enableSplashScreen?: boolean; splashTheming?: boolean;