feat: implement transparency for Windows
This commit is contained in:
parent
b4da701080
commit
0db6fa8f90
3 changed files with 41 additions and 1 deletions
|
@ -262,6 +262,13 @@ function createMainWindow() {
|
||||||
},
|
},
|
||||||
icon: ICON_PATH,
|
icon: ICON_PATH,
|
||||||
frame: VencordSettings.store.frameless !== true,
|
frame: VencordSettings.store.frameless !== true,
|
||||||
|
...(Settings.store.transparent
|
||||||
|
? {
|
||||||
|
backgroundColor: "#00000000",
|
||||||
|
backgroundMaterial: Settings.store.transparencyOption,
|
||||||
|
transparent: true
|
||||||
|
}
|
||||||
|
: {}),
|
||||||
...(Settings.store.staticTitle ? { title: "Vencord" } : {}),
|
...(Settings.store.staticTitle ? { title: "Vencord" } : {}),
|
||||||
...(VencordSettings.store.macosTranslucency
|
...(VencordSettings.store.macosTranslucency
|
||||||
? {
|
? {
|
||||||
|
|
|
@ -10,6 +10,7 @@ import { Margins } from "@vencord/types/utils";
|
||||||
import { Button, Forms, Select, Switch, Text, useState } from "@vencord/types/webpack/common";
|
import { Button, Forms, Select, Switch, Text, useState } from "@vencord/types/webpack/common";
|
||||||
import { setBadge } from "renderer/appBadge";
|
import { setBadge } from "renderer/appBadge";
|
||||||
import { useSettings } from "renderer/settings";
|
import { useSettings } from "renderer/settings";
|
||||||
|
import { isWindows } from "renderer/utils";
|
||||||
|
|
||||||
export default function SettingsUi() {
|
export default function SettingsUi() {
|
||||||
const Settings = useSettings();
|
const Settings = useSettings();
|
||||||
|
@ -46,7 +47,7 @@ export default function SettingsUi() {
|
||||||
Vencord Desktop Settings
|
Vencord Desktop Settings
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
<Forms.FormTitle className={Margins.top16}>Discord Branch</Forms.FormTitle>
|
<Forms.FormTitle className={Margins.top16 + " " + Margins.bottom8}>Discord Branch</Forms.FormTitle>
|
||||||
<Select
|
<Select
|
||||||
placeholder="Stable"
|
placeholder="Stable"
|
||||||
options={[
|
options={[
|
||||||
|
@ -97,6 +98,36 @@ export default function SettingsUi() {
|
||||||
</Switch>
|
</Switch>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
|
{isWindows &&
|
||||||
|
<>
|
||||||
|
<Switch
|
||||||
|
value={Settings.transparent ?? false}
|
||||||
|
onChange={v => (Settings.transparent = v)}
|
||||||
|
note="Requires a full restart"
|
||||||
|
>
|
||||||
|
Enable window transparency
|
||||||
|
</Switch>
|
||||||
|
|
||||||
|
<Forms.FormTitle className={Margins.top16 + " " + Margins.bottom8}>Transparency Options</Forms.FormTitle>
|
||||||
|
|
||||||
|
<Select
|
||||||
|
placeholder="Mica"
|
||||||
|
options={[
|
||||||
|
{ label: "Mica (incorporates system theme + desktop wallpaper to \"paint\" the background)", value: "mica", default: true },
|
||||||
|
{ label: "Tabbed (variant of Mica with stronger background tinting)", value: "tabbed" },
|
||||||
|
{ label: "Acrylic (blurs the window behind Vencord Desktop for a translucent background)", value: "acrylic" }
|
||||||
|
]}
|
||||||
|
closeOnSelect={true}
|
||||||
|
select={v => (Settings.transparencyOption = v)}
|
||||||
|
isSelected={v => v === Settings.transparencyOption}
|
||||||
|
serialize={s => s}
|
||||||
|
isDisabled={!Settings.transparent}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Forms.FormDivider className={Margins.top16 + " " + Margins.bottom16} />
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
|
||||||
<Forms.FormTitle>Vencord Location</Forms.FormTitle>
|
<Forms.FormTitle>Vencord Location</Forms.FormTitle>
|
||||||
<Forms.FormText>
|
<Forms.FormText>
|
||||||
Vencord files are loaded from{" "}
|
Vencord files are loaded from{" "}
|
||||||
|
|
2
src/shared/settings.d.ts
vendored
2
src/shared/settings.d.ts
vendored
|
@ -7,6 +7,8 @@
|
||||||
import type { Rectangle } from "electron";
|
import type { Rectangle } from "electron";
|
||||||
|
|
||||||
export interface Settings {
|
export interface Settings {
|
||||||
|
transparent?: boolean;
|
||||||
|
transparencyOption?: "mica" | "tabbed" | "acrylic";
|
||||||
maximized?: boolean;
|
maximized?: boolean;
|
||||||
minimized?: boolean;
|
minimized?: boolean;
|
||||||
windowBounds?: Rectangle;
|
windowBounds?: Rectangle;
|
||||||
|
|
Reference in a new issue