feat: implement transparency for Windows (#46)
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
import { app, dialog, ipcMain, session, shell } from "electron";
|
||||
import { existsSync, readFileSync, watch } from "fs";
|
||||
import { open, readFile } from "fs/promises";
|
||||
import { release } from "os";
|
||||
import { join } from "path";
|
||||
import { debounce } from "shared/utils/debounce";
|
||||
|
||||
@@ -41,6 +42,10 @@ ipcMain.on(IpcEvents.GET_VERSION, e => {
|
||||
e.returnValue = app.getVersion();
|
||||
});
|
||||
|
||||
ipcMain.on(IpcEvents.SUPPORTS_WINDOWS_TRANSPARENCY, e => {
|
||||
e.returnValue = process.platform === "win32" && Number(release().split(".").pop()) >= 22621;
|
||||
});
|
||||
|
||||
ipcMain.on(IpcEvents.AUTOSTART_ENABLED, e => {
|
||||
e.returnValue = autoStart.isEnabled();
|
||||
});
|
||||
|
||||
@@ -262,6 +262,15 @@ function createMainWindow() {
|
||||
},
|
||||
icon: ICON_PATH,
|
||||
frame: VencordSettings.store.frameless !== true,
|
||||
...(Settings.store.transparencyOption !== "none"
|
||||
? {
|
||||
backgroundColor: "#00000000",
|
||||
backgroundMaterial: Settings.store.transparencyOption,
|
||||
transparent: true
|
||||
}
|
||||
: {
|
||||
transparent: false
|
||||
}),
|
||||
...(Settings.store.staticTitle ? { title: "Vencord" } : {}),
|
||||
...(VencordSettings.store.macosTranslucency
|
||||
? {
|
||||
|
||||
Reference in New Issue
Block a user