Add relative window size (#2819)
* Add relative window size * Simplify assign of height and width
This commit is contained in:
parent
e4813784d3
commit
078dbaeb6a
@ -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') {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user