also allow using discord titlebar on non-windows
This commit is contained in:
@@ -374,11 +374,11 @@ function createMainWindow() {
|
||||
removeSettingsListeners();
|
||||
removeVencordSettingsListeners();
|
||||
|
||||
const { staticTitle, transparencyOption, enableMenu, discordWindowsTitleBar } = Settings.store;
|
||||
const { staticTitle, transparencyOption, enableMenu, customTitleBar } = Settings.store;
|
||||
|
||||
const { frameless } = VencordSettings.store;
|
||||
|
||||
const noFrame = frameless === true || (process.platform === "win32" && discordWindowsTitleBar === true);
|
||||
const noFrame = frameless === true || customTitleBar === true;
|
||||
|
||||
const win = (mainWin = new BrowserWindow({
|
||||
show: false,
|
||||
@@ -398,7 +398,7 @@ function createMainWindow() {
|
||||
backgroundMaterial: transparencyOption
|
||||
}),
|
||||
// Fix transparencyOption for custom discord titlebar
|
||||
...(discordWindowsTitleBar &&
|
||||
...(customTitleBar &&
|
||||
transparencyOption &&
|
||||
transparencyOption !== "none" && {
|
||||
transparent: true
|
||||
|
||||
@@ -35,9 +35,15 @@ function loadSettings<T extends object = any>(file: string, name: string) {
|
||||
}
|
||||
|
||||
export const Settings = loadSettings<TSettings>(SETTINGS_FILE, "Vesktop settings");
|
||||
if (Object.hasOwn(Settings.plain, "discordWindowsTitleBar")) {
|
||||
Settings.plain.customTitleBar = Settings.plain.discordWindowsTitleBar;
|
||||
delete Settings.plain.discordWindowsTitleBar;
|
||||
Settings.markAsChanged();
|
||||
}
|
||||
|
||||
export const VencordSettings = loadSettings<any>(VENCORD_SETTINGS_FILE, "Vencord settings");
|
||||
|
||||
if (Object.hasOwn(Settings.store, "firstLaunch") && !existsSync(STATE_FILE)) {
|
||||
if (Object.hasOwn(Settings.plain, "firstLaunch") && !existsSync(STATE_FILE)) {
|
||||
console.warn("legacy state in settings.json detected. migrating to state.json");
|
||||
const state = {} as TState;
|
||||
for (const prop of [
|
||||
@@ -47,7 +53,7 @@ if (Object.hasOwn(Settings.store, "firstLaunch") && !existsSync(STATE_FILE)) {
|
||||
"skippedUpdate",
|
||||
"steamOSLayoutVersion",
|
||||
"windowBounds"
|
||||
]) {
|
||||
] as const) {
|
||||
state[prop] = Settings.plain[prop];
|
||||
delete Settings.plain[prop];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user