mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-29 02:11:28 -06:00
SDA-2160 Parse and apply --windowSize command line argument
This commit is contained in:
parent
35d0666262
commit
ada0a956ef
@ -40,6 +40,8 @@ import {
|
||||
windowExists,
|
||||
} from './window-utils';
|
||||
|
||||
const windowSize: string | null = getCommandLineArgs(process.argv, '--window-size', false);
|
||||
|
||||
enum ClientSwitchType {
|
||||
CLIENT_1_5 = 'CLIENT_1_5',
|
||||
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
|
||||
this.mainWindow = new BrowserWindow({
|
||||
...this.windowOpts, ...getBounds(this.config.mainWinPos, DEFAULT_WIDTH, DEFAULT_HEIGHT),
|
||||
|
Loading…
Reference in New Issue
Block a user