make it possibe to start in minimized mode

This commit is contained in:
Michal Vaniš 2023-11-18 23:44:09 +01:00
parent 49e0411be6
commit 04715c4427
4 changed files with 9 additions and 5 deletions

View file

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

View file

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

View file

@ -48,7 +48,8 @@ export default function SettingsUi() {
"Open Links in app (experimental)",
"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);

View file

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