mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-31 19:27:00 -06:00
Merge pull request #1019 from mattias-symphony/SDA-2160
fix: SDA-2160 Parse and apply --windowSize command line argument
This commit is contained in:
commit
e258f01db4
@ -40,6 +40,8 @@ import {
|
|||||||
windowExists,
|
windowExists,
|
||||||
} from './window-utils';
|
} from './window-utils';
|
||||||
|
|
||||||
|
const windowSize: string | null = getCommandLineArgs(process.argv, '--window-size', false);
|
||||||
|
|
||||||
enum ClientSwitchType {
|
enum ClientSwitchType {
|
||||||
CLIENT_1_5 = 'CLIENT_1_5',
|
CLIENT_1_5 = 'CLIENT_1_5',
|
||||||
CLIENT_2_0 = 'CLIENT_2_0',
|
CLIENT_2_0 = 'CLIENT_2_0',
|
||||||
@ -209,6 +211,20 @@ export class WindowHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger.info('window-handler: windowSize: ' + JSON.stringify(windowSize));
|
||||||
|
if (windowSize) {
|
||||||
|
const args = windowSize.split('=');
|
||||||
|
const sizes = args[1].split(',');
|
||||||
|
logger.info('window-handler: windowSize: args: ' + JSON.stringify(args));
|
||||||
|
logger.info('window-handler: windowSize: sizes: ' + JSON.stringify(sizes));
|
||||||
|
DEFAULT_WIDTH = Number(sizes[0]);
|
||||||
|
DEFAULT_HEIGHT = Number(sizes[1]);
|
||||||
|
if (this.config.mainWinPos ) {
|
||||||
|
this.config.mainWinPos.width = DEFAULT_WIDTH;
|
||||||
|
this.config.mainWinPos.height = DEFAULT_HEIGHT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// set window opts with additional config
|
// set window opts with additional config
|
||||||
this.mainWindow = new BrowserWindow({
|
this.mainWindow = new BrowserWindow({
|
||||||
...this.windowOpts, ...getBounds(this.config.mainWinPos, DEFAULT_WIDTH, DEFAULT_HEIGHT),
|
...this.windowOpts, ...getBounds(this.config.mainWinPos, DEFAULT_WIDTH, DEFAULT_HEIGHT),
|
||||||
|
Loading…
Reference in New Issue
Block a user