Add relative window size (#2819)

* Add relative window size

* Simplify assign of height and width
This commit is contained in:
Jakub Jóźwiak 2020-05-26 16:27:59 +02:00 committed by GitHub
parent e4813784d3
commit 078dbaeb6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,19 +2,20 @@
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { BrowserWindow, app } from 'electron';
import { BrowserWindow, app, screen } from 'electron';
import path from 'path';
const environment = process.env.NODE_ENV || 'production';
function createWindow (): Promise<unknown> {
// Create the browser window.
const { height, width } = screen.getPrimaryDisplay().workAreaSize;
const win = new BrowserWindow({
height: 600,
height,
webPreferences: {
nodeIntegration: true
},
width: 800
width
});
if (environment === 'development') {