Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Vendicated committed Jul 14, 2023
1 parent 5b1ff6e commit 5237ab4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/main/mainWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ function createMainWindow() {
removeSettingsListeners();
removeVencordSettingsListeners();

const { staticTitle, transparencyOption } = Settings.store;
const { staticTitle, transparencyOption, splashTheming, splashBackground } = Settings.store;
const { frameless, macosTranslucency } = VencordSettings.store;
const win = (mainWin = new BrowserWindow({
show: false,
Expand All @@ -329,12 +329,12 @@ function createMainWindow() {
...(transparencyOption && transparencyOption !== "none"
? {
backgroundColor: "#00000000",
backgroundMaterial: Settings.store.transparencyOption,
backgroundMaterial: transparencyOption,
transparent: true
}
: {
backgroundColor: Settings.store.splashTheming
? Settings.store.splashBackground
backgroundColor: splashTheming
? splashBackground
: nativeTheme.shouldUseDarkColors
? "#313338"
: "#ffffff",
Expand Down Expand Up @@ -390,7 +390,7 @@ function createMainWindow() {
const runVencordMain = once(() => require(join(VENCORD_FILES_DIR, "vencordDesktopMain.js")));

export async function createWindows() {
const splash = await createSplashWindow();
const splash = createSplashWindow();

await ensureVencordFiles();
runVencordMain();
Expand Down
11 changes: 5 additions & 6 deletions src/main/splash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@ import { VIEW_DIR } from "shared/paths";

import { Settings } from "./settings";

export async function createSplashWindow() {
export function createSplashWindow() {
const splash = new BrowserWindow(SplashProps);

splash.loadFile(join(VIEW_DIR, "splash.html"));

if (Settings.store.splashTheming) {
if (Settings.store.splashColor)
splash.webContents.insertCSS(`body { --fg: ${Settings.store.splashColor} !important }`);
if (Settings.store.splashBackground)
splash.webContents.insertCSS(`body { --bg: ${Settings.store.splashBackground} !important }`);
const { splashBackground, splashColor, splashTheming } = Settings.store;
if (splashTheming) {
if (splashColor) splash.webContents.insertCSS(`body { --fg: ${splashColor} !important }`);
if (splashBackground) splash.webContents.insertCSS(`body { --bg: ${splashBackground} !important }`);
}

return splash;
Expand Down

0 comments on commit 5237ab4

Please sign in to comment.