diff options
author | Kaydax <kaydax@kaydax.xyz> | 2023-01-28 17:54:38 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-28 23:54:38 +0100 |
commit | 072ad3d7e67300c1de25858b790670a46fb6c10e (patch) | |
tree | b09a8b42f613c509263a9a15b02de5e1808cc0fc | |
parent | 6e22a96d9eed97ecc1991962fe965ea352ad5549 (diff) | |
download | Vencord-072ad3d7e67300c1de25858b790670a46fb6c10e.tar.gz Vencord-072ad3d7e67300c1de25858b790670a46fb6c10e.tar.bz2 Vencord-072ad3d7e67300c1de25858b790670a46fb6c10e.zip |
feat(settings): Add the ability to make the window transparent (#457)
-rw-r--r-- | src/api/settings.ts | 2 | ||||
-rw-r--r-- | src/components/VencordSettings/VencordTab.tsx | 7 | ||||
-rw-r--r-- | src/patcher.ts | 4 |
3 files changed, 13 insertions, 0 deletions
diff --git a/src/api/settings.ts b/src/api/settings.ts index 4cdb24b..d20e964 100644 --- a/src/api/settings.ts +++ b/src/api/settings.ts @@ -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: {} }; diff --git a/src/components/VencordSettings/VencordTab.tsx b/src/components/VencordSettings/VencordTab.tsx index e1632b1..9f55d57 100644 --- a/src/components/VencordSettings/VencordTab.tsx +++ b/src/components/VencordSettings/VencordTab.tsx @@ -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} diff --git a/src/patcher.ts b/src/patcher.ts index 64bc502..d51405d 100644 --- a/src/patcher.ts +++ b/src/patcher.ts @@ -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; |