added x and y co-ordinates to windowConfig

This commit is contained in:
ImKaashif 2024-01-20 17:44:22 +05:30 committed by Jonatan Heyman
parent 295e55552b
commit 5e169a1927

View File

@ -75,11 +75,18 @@ export function quit() {
async function createWindow() { async function createWindow() {
// read any stored window settings from config, or use defaults // read any stored window settings from config, or use defaults
let window_offset = {}
if(CONFIG.get("windowConfig.x") && CONFIG.get("windowConfig.y")) window_offset = {
x: CONFIG.get("windowConfig.x"),
y: CONFIG.get("windowConfig.y")
} //getting the x and y co-ordinates for window position from last session(if available)
let windowConfig = { let windowConfig = {
width: CONFIG.get("windowConfig.width", 900) as number, width: CONFIG.get("windowConfig.width", 900) as number,
height: CONFIG.get("windowConfig.height", 680) as number, height: CONFIG.get("windowConfig.height", 680) as number,
isMaximized: CONFIG.get("windowConfig.isMaximized", false) as boolean, isMaximized: CONFIG.get("windowConfig.isMaximized", false) as boolean,
isFullScreen: CONFIG.get("windowConfig.isFullScreen", false) as boolean, isFullScreen: CONFIG.get("windowConfig.isFullScreen", false) as boolean,
...window_offset,
} }
win = new BrowserWindow(Object.assign({ win = new BrowserWindow(Object.assign({