feat(settings): Add the ability to make the window transparent (#457)

This commit is contained in:
Kaydax 2023-01-28 17:54:38 -05:00 committed by GitHub
parent 6e22a96d9e
commit 072ad3d7e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 0 deletions

View File

@ -32,6 +32,7 @@ export interface Settings {
enableReactDevtools: boolean;
themeLinks: string[];
frameless: boolean;
transparent: boolean;
winCtrlQ: boolean;
plugins: {
[plugin: string]: {
@ -48,6 +49,7 @@ const DefaultSettings: Settings = {
themeLinks: [],
enableReactDevtools: false,
frameless: false,
transparent: false,
winCtrlQ: false,
plugins: {}
};

View File

@ -108,6 +108,13 @@ function VencordSettings() {
>
Disable the window frame
</Switch>
<Switch
value={settings.transparent}
onChange={(v: boolean) => settings.transparent = v}
note="Requires a full restart"
>
Enable window transparency
</Switch>
{navigator.platform.toLowerCase().startsWith("win") && (
<Switch
value={settings.winCtrlQ}

View File

@ -80,6 +80,10 @@ if (!process.argv.includes("--vanilla")) {
if (settings.frameless) {
options.frame = false;
}
if (settings.transparent) {
options.transparent = true;
options.backgroundColor = "#00000000";
}
process.env.DISCORD_PRELOAD = original;