diff --git a/src/main/splash.ts b/src/main/splash.ts index f21799d..f736789 100644 --- a/src/main/splash.ts +++ b/src/main/splash.ts @@ -11,6 +11,23 @@ import { ICON_PATH, VIEW_DIR } from "shared/paths"; import { Settings } from "./settings"; +export function patchVencordView(view: BrowserWindow) { + const { splashBackground, splashColor, splashTheming } = Settings.store; + + if (splashTheming) { + if (splashColor) { + const semiTransparentSplashColor = splashColor.replace("rgb(", "rgba(").replace(")", ", 0.2)"); + + view.webContents.insertCSS(`body { --fg: ${splashColor} !important }`); + view.webContents.insertCSS(`body { --fg-semi-trans: ${semiTransparentSplashColor} !important }`); + } + + if (splashBackground) { + view.webContents.insertCSS(`body { --bg: ${splashBackground} !important }`); + } + } +} + export function createSplashWindow() { const splash = new BrowserWindow({ ...SplashProps, @@ -18,21 +35,7 @@ export function createSplashWindow() { }); splash.loadFile(join(VIEW_DIR, "splash.html")); - - const { splashBackground, splashColor, splashTheming } = Settings.store; - - if (splashTheming) { - if (splashColor) { - const semiTransparentSplashColor = splashColor.replace("rgb(", "rgba(").replace(")", ", 0.2)"); - - splash.webContents.insertCSS(`body { --fg: ${splashColor} !important }`); - splash.webContents.insertCSS(`body { --fg-semi-trans: ${semiTransparentSplashColor} !important }`); - } - - if (splashBackground) { - splash.webContents.insertCSS(`body { --bg: ${splashBackground} !important }`); - } - } + patchVencordView(splash); return splash; } diff --git a/src/updater/main.ts b/src/updater/main.ts index ec42217..d415bda 100644 --- a/src/updater/main.ts +++ b/src/updater/main.ts @@ -6,6 +6,7 @@ import { app, BrowserWindow, shell } from "electron"; import { Settings } from "main/settings"; +import { patchVencordView } from "main/splash"; import { handle } from "main/utils/ipcWrappers"; import { makeLinksOpenExternally } from "main/utils/makeLinksOpenExternally"; import { githubGet, ReleaseData } from "main/utils/vencordLoader"; @@ -109,10 +110,12 @@ function openNewUpdateWindow() { contextIsolation: true, sandbox: true }, + ...(process.platform === "darwin" ? { titleBarStyle: "hiddenInset" } : {}), icon: ICON_PATH }); makeLinksOpenExternally(win); + patchVencordView(win); win.loadFile(join(VIEW_DIR, "updater.html")); }