added transparency option
and changed the customTitleBar check to only be used on windows (according to electron spec)
This commit is contained in:
parent
b20c77734c
commit
e764c51e77
2 changed files with 19 additions and 2 deletions
|
@ -370,6 +370,7 @@ function createMainWindow() {
|
|||
const { frameless } = VencordSettings.store;
|
||||
|
||||
const noFrame = frameless === true || customTitleBar === true;
|
||||
const isWindows = process.platform === "win32";
|
||||
|
||||
const win = (mainWin = new BrowserWindow({
|
||||
show: false,
|
||||
|
@ -388,8 +389,8 @@ function createMainWindow() {
|
|||
backgroundColor: "#00000000",
|
||||
backgroundMaterial: transparencyOption
|
||||
}),
|
||||
// Fix transparencyOption for custom discord titlebar
|
||||
...(customTitleBar &&
|
||||
// Fix transparencyOption for custom discord titlebar on Windows
|
||||
...((customTitleBar || !isWindows) &&
|
||||
transparencyOption &&
|
||||
transparencyOption !== "none" && {
|
||||
transparent: true
|
||||
|
|
|
@ -16,6 +16,7 @@ import { isTruthy } from "shared/utils/guards";
|
|||
export default function SettingsUi() {
|
||||
const Settings = useSettings();
|
||||
const supportsWindowsTransparency = VesktopNative.app.supportsWindowsTransparency();
|
||||
const isWindows = process.platform === "win32";
|
||||
|
||||
const { autostart } = VesktopNative;
|
||||
const [autoStartEnabled, setAutoStartEnabled] = useState(autostart.isEnabled());
|
||||
|
@ -100,6 +101,21 @@ export default function SettingsUi() {
|
|||
Notification Badge
|
||||
</Switch>
|
||||
|
||||
{!isWindows && (
|
||||
<>
|
||||
<Switch
|
||||
value={Settings.transparencyOption!="none"}
|
||||
onChange={v => {
|
||||
//just set it to a random value that isn't none to keep consistency with Windows
|
||||
Settings.transparencyOption=v ? "acrylic":"none";
|
||||
}}
|
||||
note="Requires a full restart. You will need a theme that supports transparency for this to work."
|
||||
>
|
||||
Transparency
|
||||
</Switch>
|
||||
</>
|
||||
)}
|
||||
|
||||
{switches.map(([key, text, note, def, predicate]) => (
|
||||
<Switch
|
||||
value={(Settings[key as any] ?? def ?? false) && predicate?.() !== false}
|
||||
|
|
Reference in a new issue