rework Custom Titlebar setting -> Native Titlebar
This commit is contained in:
@@ -337,14 +337,14 @@ function buildBrowserWindowOptions(): BrowserWindowConstructorOptions {
|
|||||||
enableMenu,
|
enableMenu,
|
||||||
enableShadow,
|
enableShadow,
|
||||||
enableRoundedCorners,
|
enableRoundedCorners,
|
||||||
customTitleBar,
|
nativeTitleBar,
|
||||||
splashTheming,
|
splashTheming,
|
||||||
splashBackground
|
splashBackground
|
||||||
} = Settings.store;
|
} = 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 =
|
const backgroundColor =
|
||||||
splashTheming !== false ? splashBackground : nativeTheme.shouldUseDarkColors ? "#313338" : "#ffffff";
|
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
|
// disable renderer backgrounding to prevent the app from unloading when in the background
|
||||||
backgroundThrottling: false
|
backgroundThrottling: false
|
||||||
},
|
},
|
||||||
frame: !noFrame,
|
frame: !frameless,
|
||||||
autoHideMenuBar: enableMenu,
|
autoHideMenuBar: enableMenu,
|
||||||
hasShadow: enableShadow !== false,
|
hasShadow: enableShadow !== false,
|
||||||
roundedCorners: enableRoundedCorners !== false,
|
roundedCorners: enableRoundedCorners !== false,
|
||||||
@@ -377,7 +377,7 @@ function buildBrowserWindowOptions(): BrowserWindowConstructorOptions {
|
|||||||
options.backgroundColor = "#00000000";
|
options.backgroundColor = "#00000000";
|
||||||
options.backgroundMaterial = transparencyOption;
|
options.backgroundMaterial = transparencyOption;
|
||||||
|
|
||||||
if (customTitleBar) {
|
if (frameless) {
|
||||||
options.transparent = true;
|
options.transparent = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -407,7 +407,7 @@ function createMainWindow() {
|
|||||||
const win = (mainWin = new BrowserWindow(buildBrowserWindowOptions()));
|
const win = (mainWin = new BrowserWindow(buildBrowserWindowOptions()));
|
||||||
|
|
||||||
win.setMenuBarVisibility(false);
|
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 => {
|
win.on("close", e => {
|
||||||
const useTray = !isDeckGameMode && Settings.store.minimizeToTray !== false && Settings.store.tray !== false;
|
const useTray = !isDeckGameMode && Settings.store.minimizeToTray !== false && Settings.store.tray !== false;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { BaseText, Divider, ErrorBoundary } from "@vencord/types/components";
|
|||||||
import { ComponentType } from "react";
|
import { ComponentType } from "react";
|
||||||
import { WebRTCIPHandlingPolicyPicker } from "renderer/components/settings/WebRTCIPHandlingPolicyPicker";
|
import { WebRTCIPHandlingPolicyPicker } from "renderer/components/settings/WebRTCIPHandlingPolicyPicker";
|
||||||
import { Settings, useSettings } from "renderer/settings";
|
import { Settings, useSettings } from "renderer/settings";
|
||||||
import { isMac, isWindows } from "renderer/utils";
|
import { isMac } from "renderer/utils";
|
||||||
|
|
||||||
import { AutoStartToggle } from "./AutoStartToggle";
|
import { AutoStartToggle } from "./AutoStartToggle";
|
||||||
import { DeveloperOptionsButton } from "./DeveloperOptions";
|
import { DeveloperOptionsButton } from "./DeveloperOptions";
|
||||||
@@ -56,10 +56,10 @@ const SettingsOptions: Record<string, Array<BooleanSetting | SettingsComponent>>
|
|||||||
],
|
],
|
||||||
"User Interface": [
|
"User Interface": [
|
||||||
{
|
{
|
||||||
key: "customTitleBar",
|
key: "nativeTitleBar",
|
||||||
title: "Discord Titlebar",
|
title: "Native Titlebar",
|
||||||
description: "Use Discord's custom title bar instead of the native system one. Requires a full restart.",
|
description: "Enable the system titlebar in addition to Discord's custom one. Requires a full restart.",
|
||||||
defaultValue: isWindows
|
defaultValue: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "staticTitle",
|
key: "staticTitle",
|
||||||
@@ -72,21 +72,21 @@ const SettingsOptions: Record<string, Array<BooleanSetting | SettingsComponent>>
|
|||||||
title: "Enable Menu Bar",
|
title: "Enable Menu Bar",
|
||||||
description: "Enables the application menu bar. Press ALT to toggle visibility.",
|
description: "Enables the application menu bar. Press ALT to toggle visibility.",
|
||||||
defaultValue: false,
|
defaultValue: false,
|
||||||
disabled: () => Settings.store.customTitleBar ?? isWindows
|
disabled: () => Settings.store.nativeTitleBar !== true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "enableShadow",
|
key: "enableShadow",
|
||||||
title: "Enable Window Shadow",
|
title: "Enable Window Shadow",
|
||||||
description: "Enables the window shadow. Requires a full restart.",
|
description: "Enables the window shadow. Requires a full restart.",
|
||||||
defaultValue: true,
|
defaultValue: true,
|
||||||
disabled: () => Settings.store.customTitleBar !== true
|
disabled: () => Settings.store.nativeTitleBar === true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "enableRoundedCorners",
|
key: "enableRoundedCorners",
|
||||||
title: "Enable Rounded Corners",
|
title: "Enable Rounded Corners",
|
||||||
description: "Enables rounded corners. Requires a full restart.",
|
description: "Enables rounded corners. Requires a full restart.",
|
||||||
defaultValue: true,
|
defaultValue: true,
|
||||||
disabled: () => Settings.store.customTitleBar !== true
|
disabled: () => Settings.store.nativeTitleBar === true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "enableSplashScreen",
|
key: "enableSplashScreen",
|
||||||
|
|||||||
Vendored
+1
-1
@@ -30,7 +30,7 @@ export interface Settings {
|
|||||||
enableTaskbarFlashing?: boolean;
|
enableTaskbarFlashing?: boolean;
|
||||||
disableMinSize?: boolean;
|
disableMinSize?: boolean;
|
||||||
clickTrayToShowHide?: boolean;
|
clickTrayToShowHide?: boolean;
|
||||||
customTitleBar?: boolean;
|
nativeTitleBar?: boolean;
|
||||||
|
|
||||||
enableSplashScreen?: boolean;
|
enableSplashScreen?: boolean;
|
||||||
splashTheming?: boolean;
|
splashTheming?: boolean;
|
||||||
|
|||||||
Reference in New Issue
Block a user