-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Persist window location when opening the app #171
Comments
Hi, @heyman, I was looking into this enhancement request and this can be achieved by adding this to config while creating let windowConfig = {
width: CONFIG.get("windowConfig.width", 900) as number,
height: CONFIG.get("windowConfig.height", 680) as number,
x: CONFIG.get("windowConfig.x") as number,
y: CONFIG.get("windowConfig.y") as number,
isMaximized: CONFIG.get("windowConfig.isMaximized", false) as boolean,
isFullScreen: CONFIG.get("windowConfig.isFullScreen", false) as boolean,
} but the problem here is a default value in case x and y are not found in config, we cant just pass any arbitrary value as we would like to center the window in that case, I can technically do the following to avoid passing the x and y value in case they are not present and window will automatically be centered, let window_offset = {};
if(CONFIG.get("windowConfig.x") && CONFIG.get("windowConfig.y")) window_offset = {
x: CONFIG.get("windowConfig.x") as number,
y: CONFIG.get("windowConfig.y") as number,
}
let windowConfig = {
width: CONFIG.get("windowConfig.width", 900) as number,
height: CONFIG.get("windowConfig.height", 680) as number,
isMaximized: CONFIG.get("windowConfig.isMaximized", false) as boolean,
isFullScreen: CONFIG.get("windowConfig.isFullScreen", false) as boolean,
...window_offset
} this will get the job done but I am not sure if it's the right way of doing this. Could you share your opinions on this? |
Fixed by #171 |
Currently the application always opens in the center of the primary monitor.
This request is for the window to open up wherever it was when it was last closed.
The text was updated successfully, but these errors were encountered: