Revert "feat: Add start as minimized toggle to settings (#248)" (#310)

the current implementation was prematurely merged and is broken. it will be back with a fixed implementaton eventually
This commit is contained in:
V 2023-12-28 04:25:54 +01:00 committed by GitHub
parent 7565eb39a4
commit 2f35128acf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 15 deletions

View file

@ -442,8 +442,7 @@ function createMainWindow() {
const runVencordMain = once(() => require(join(VENCORD_FILES_DIR, "vencordDesktopMain.js"))); const runVencordMain = once(() => require(join(VENCORD_FILES_DIR, "vencordDesktopMain.js")));
export async function createWindows() { export async function createWindows() {
const { startMinimized } = Settings.store; const splash = createSplashWindow();
const splash = createSplashWindow(startMinimized);
// SteamOS letterboxes and scales it terribly, so just full screen it // SteamOS letterboxes and scales it terribly, so just full screen it
if (isDeckGameMode) splash.setFullScreen(true); if (isDeckGameMode) splash.setFullScreen(true);
await ensureVencordFiles(); await ensureVencordFiles();
@ -453,8 +452,11 @@ export async function createWindows() {
mainWin.webContents.on("did-finish-load", () => { mainWin.webContents.on("did-finish-load", () => {
splash.destroy(); splash.destroy();
mainWin!.show();
if (!startMinimized || isDeckGameMode) mainWin!.show(); if (Settings.store.maximized && !isDeckGameMode) {
mainWin!.maximize();
}
if (isDeckGameMode) { if (isDeckGameMode) {
// always use entire display // always use entire display
@ -464,11 +466,5 @@ export async function createWindows() {
} }
}); });
mainWin.once("show", () => {
if (Settings.store.maximized && !mainWin!.isMaximized() && !isDeckGameMode) {
mainWin!.maximize();
}
});
initArRPC(); initArRPC();
} }

View file

@ -11,11 +11,10 @@ import { ICON_PATH, VIEW_DIR } from "shared/paths";
import { Settings } from "./settings"; import { Settings } from "./settings";
export function createSplashWindow(startMinimized = false) { export function createSplashWindow() {
const splash = new BrowserWindow({ const splash = new BrowserWindow({
...SplashProps, ...SplashProps,
icon: ICON_PATH, icon: ICON_PATH
show: !startMinimized
}); });
splash.loadFile(join(VIEW_DIR, "splash.html")); splash.loadFile(join(VIEW_DIR, "splash.html"));

View file

@ -49,8 +49,7 @@ export default function SettingsUi() {
"Open Links in app (experimental)", "Open Links in app (experimental)",
"Opens links in a new Vesktop window instead of your web browser" "Opens links in a new Vesktop window instead of your web browser"
], ],
["checkUpdates", "Check for updates", "Automatically check for Vesktop updates", true], ["checkUpdates", "Check for updates", "Automatically check for Vesktop updates", true]
["startMinimized", "Start minimized", "Vesktop remains in minimized mode on start", false]
]; ];
const switches = allSwitches.filter(isTruthy); const switches = allSwitches.filter(isTruthy);

View file

@ -19,7 +19,6 @@ export interface Settings {
arRPC?: boolean; arRPC?: boolean;
appBadge?: boolean; appBadge?: boolean;
discordWindowsTitleBar?: boolean; discordWindowsTitleBar?: boolean;
startMinimized?: boolean;
maximized?: boolean; maximized?: boolean;
minimized?: boolean; minimized?: boolean;