Windows: Add Option to use native titlebar ~ Closes #537
This commit is contained in:
parent
5ec517875e
commit
4918d699d5
@ -95,3 +95,12 @@ async function init() {
|
||||
}
|
||||
|
||||
init();
|
||||
|
||||
if (!IS_WEB && Settings.winNativeTitleBar && navigator.platform.toLowerCase().startsWith("win")) {
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
document.head.append(Object.assign(document.createElement("style"), {
|
||||
id: "vencord-native-titlebar-style",
|
||||
textContent: "[class*=titleBar-]{display: none!important}"
|
||||
}));
|
||||
}, { once: true });
|
||||
}
|
||||
|
@ -34,6 +34,7 @@ export interface Settings {
|
||||
frameless: boolean;
|
||||
transparent: boolean;
|
||||
winCtrlQ: boolean;
|
||||
winNativeTitleBar: boolean;
|
||||
plugins: {
|
||||
[plugin: string]: {
|
||||
enabled: boolean;
|
||||
@ -57,6 +58,7 @@ const DefaultSettings: Settings = {
|
||||
frameless: false,
|
||||
transparent: false,
|
||||
winCtrlQ: false,
|
||||
winNativeTitleBar: false,
|
||||
plugins: {},
|
||||
|
||||
notifications: {
|
||||
|
@ -63,11 +63,15 @@ function VencordSettings() {
|
||||
title: "Enable React Developer Tools",
|
||||
note: "Requires a full restart"
|
||||
},
|
||||
!IS_WEB && !isWindows && {
|
||||
!IS_WEB && (!isWindows ? {
|
||||
key: "frameless",
|
||||
title: "Disable the window frame",
|
||||
note: "Requires a full restart"
|
||||
},
|
||||
} : {
|
||||
key: "winNativeTitleBar",
|
||||
title: "Use Windows' native title bar instead of Discord's custom one",
|
||||
note: "Requires a full restart"
|
||||
}),
|
||||
!IS_WEB && {
|
||||
key: "transparent",
|
||||
title: "Enable window transparency",
|
||||
|
@ -79,7 +79,10 @@ if (!process.argv.includes("--vanilla")) {
|
||||
options.webPreferences.sandbox = false;
|
||||
if (settings.frameless) {
|
||||
options.frame = false;
|
||||
} else if (process.platform === "win32" && settings.winNativeTitleBar) {
|
||||
delete options.frame;
|
||||
}
|
||||
|
||||
if (settings.transparent) {
|
||||
options.transparent = true;
|
||||
options.backgroundColor = "#00000000";
|
||||
|
Loading…
x
Reference in New Issue
Block a user