feat: use inset title bar style on macOS
This commit is contained in:
parent
72f83c3ac4
commit
ac284501e7
3 changed files with 32 additions and 0 deletions
|
@ -290,6 +290,7 @@ function createMainWindow() {
|
||||||
backgroundColor: "#ffffff00"
|
backgroundColor: "#ffffff00"
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
|
...(process.platform === "darwin" ? { titleBarStyle: "hiddenInset" } : {}),
|
||||||
...getWindowBoundsOptions()
|
...getWindowBoundsOptions()
|
||||||
}));
|
}));
|
||||||
win.setMenuBarVisibility(false);
|
win.setMenuBarVisibility(false);
|
||||||
|
|
|
@ -6,3 +6,4 @@
|
||||||
|
|
||||||
// TODO: Possibly auto generate glob if we have more patches in the future
|
// TODO: Possibly auto generate glob if we have more patches in the future
|
||||||
import "./spellCheck";
|
import "./spellCheck";
|
||||||
|
import "./platformClass";
|
||||||
|
|
30
src/renderer/patches/platformClass.tsx
Normal file
30
src/renderer/patches/platformClass.tsx
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
/*
|
||||||
|
* SPDX-License-Identifier: GPL-3.0
|
||||||
|
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
|
||||||
|
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { addPatch } from "./shared";
|
||||||
|
|
||||||
|
addPatch({
|
||||||
|
patches: [
|
||||||
|
{
|
||||||
|
find: "platform-web",
|
||||||
|
replacement: {
|
||||||
|
// eslint-disable-next-line no-useless-escape
|
||||||
|
match: /return (?=__OVERLAY__\?""\.concat\((\i))/,
|
||||||
|
replace: "$1=$self.getPlatformClass(); return "
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
getPlatformClass() {
|
||||||
|
const platform = navigator.platform.toLowerCase();
|
||||||
|
|
||||||
|
if (platform.includes("mac")) return "platform-osx";
|
||||||
|
if (platform.includes("win")) return "platform-win";
|
||||||
|
if (platform.includes("linux")) return "platform-linux";
|
||||||
|
|
||||||
|
return "platform-web";
|
||||||
|
}
|
||||||
|
});
|
Reference in a new issue