SDA-3475 - Remove assigning window size to config (#1303)

This commit is contained in:
Kiran Niranjan 2021-12-01 07:57:38 +05:30 committed by GitHub
parent 830f0d3676
commit bf2f43da93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -300,6 +300,12 @@ export class WindowHandler {
return;
}
// set window opts with additional config
this.mainWindow = new BrowserWindow({
...this.windowOpts,
...getBounds(this.config.mainWinPos, DEFAULT_WIDTH, DEFAULT_HEIGHT),
}) as ICustomBrowserWindow;
logger.info('window-handler: windowSize: ' + JSON.stringify(windowSize));
if (windowSize) {
const args = windowSize.split('=');
@ -308,23 +314,11 @@ export class WindowHandler {
logger.info(
'window-handler: windowSize: sizes: ' + JSON.stringify(sizes),
);
if (this.config.mainWinPos) {
this.config.mainWinPos.width = Number(sizes[0]);
this.config.mainWinPos.height = Number(sizes[1]);
} else {
this.config.mainWinPos = {
width: Number(sizes[0]),
height: Number(sizes[1]),
};
if (this.mainWindow && windowExists(this.mainWindow)) {
this.mainWindow.setSize(Number(sizes[0]), Number(sizes[1]));
}
}
// set window opts with additional config
this.mainWindow = new BrowserWindow({
...this.windowOpts,
...getBounds(this.config.mainWinPos, DEFAULT_WIDTH, DEFAULT_HEIGHT),
}) as ICustomBrowserWindow;
// Hide electron's default menu bar for Windows
if (isWindowsOS && this.mainWindow && windowExists(this.mainWindow)) {
this.mainWindow.setMenuBarVisibility(false);