feat: use inset title bar style on macOS (#47)

Co-authored-by: V <vendicated@riseup.net>
This commit is contained in:
Ryan Cao 2023-07-14 00:07:48 +00:00 committed by GitHub
parent 70ca06eb16
commit 6d35be79b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 0 deletions

View file

@ -289,6 +289,7 @@ function createMainWindow() {
backgroundColor: "#ffffff00" backgroundColor: "#ffffff00"
} }
: {}), : {}),
...(process.platform === "darwin" ? { titleBarStyle: "hiddenInset" } : {}),
...getWindowBoundsOptions() ...getWindowBoundsOptions()
})); }));
win.setMenuBarVisibility(false); win.setMenuBarVisibility(false);

View file

@ -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";

View file

@ -0,0 +1,22 @@
/*
* SPDX-License-Identifier: GPL-3.0
* Vesktop, 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: /(?<=" platform-overlay"\):)\i/,
replace: "$self.getPlatformClass()"
}
}
],
getPlatformClass: () => (navigator.platform.toLowerCase().startsWith("mac") ? "platform-osx" : "platform-web")
});