Change default window size to fit QR login

This commit is contained in:
smartfrigde 2023-05-13 22:42:35 +02:00
parent a07546f28e
commit 017ee7b430

View file

@ -82,23 +82,23 @@ export function registerIpc(): void {
event.returnValue = packageVersion; event.returnValue = packageVersion;
}); });
ipcMain.on("splashEnd", async () => { ipcMain.on("splashEnd", async () => {
let width = 800, let width = 835,
height = 600, height = 600,
isMaximized = true, isMaximized = true,
xValue = 0, xValue = 0,
yValue = 0; yValue = 0;
try { try {
width = (await getWindowState("width")) ?? 800; width = (await getWindowState("width")) ?? 835;
height = (await getWindowState("height")) ?? 600; height = (await getWindowState("height")) ?? 600;
isMaximized = (await getWindowState("isMaximized")) ?? false; isMaximized = (await getWindowState("isMaximized")) ?? false;
xValue = await getWindowState("x"); xValue = await getWindowState("x");
yValue = await getWindowState("y"); yValue = await getWindowState("y");
} catch (_e) { } catch (_e) {
console.log("[Window state manager] No window state file found. Falling back to default values."); console.log("[Window state manager] No window state file found. Falling back to default values.");
mainWindow.setSize(800, 600); mainWindow.setSize(835, 600);
} }
if (isMaximized) { if (isMaximized) {
mainWindow.setSize(800, 600); //just so the whole thing doesn't cover whole screen mainWindow.setSize(835, 600); //just so the whole thing doesn't cover whole screen
mainWindow.maximize(); mainWindow.maximize();
} else { } else {
mainWindow.setSize(width, height); mainWindow.setSize(width, height);