|
|
@ -1,5 +1,6 @@
|
|
|
|
import { app, BrowserWindow } from 'electron';
|
|
|
|
import { app, BrowserWindow } from 'electron';
|
|
|
|
import path from 'path';
|
|
|
|
import path from 'path';
|
|
|
|
|
|
|
|
import windowStateKeeper from 'electron-window-state';
|
|
|
|
|
|
|
|
|
|
|
|
const isDev = !app.isPackaged;
|
|
|
|
const isDev = !app.isPackaged;
|
|
|
|
const webUrl = isDev
|
|
|
|
const webUrl = isDev
|
|
|
@ -13,10 +14,17 @@ if (require('electron-squirrel-startup')) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const createWindow = (): void => {
|
|
|
|
const createWindow = (): void => {
|
|
|
|
|
|
|
|
const mainWindowState = windowStateKeeper({
|
|
|
|
|
|
|
|
defaultWidth: 960,
|
|
|
|
|
|
|
|
defaultHeight: 640,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// Create the browser window.
|
|
|
|
// Create the browser window.
|
|
|
|
const mainWindow = new BrowserWindow({
|
|
|
|
const mainWindow = new BrowserWindow({
|
|
|
|
height: 640,
|
|
|
|
x: mainWindowState.x,
|
|
|
|
width: 960,
|
|
|
|
y: mainWindowState.y,
|
|
|
|
|
|
|
|
height: mainWindowState.height,
|
|
|
|
|
|
|
|
width: mainWindowState.width,
|
|
|
|
minHeight: 640,
|
|
|
|
minHeight: 640,
|
|
|
|
minWidth: 960,
|
|
|
|
minWidth: 960,
|
|
|
|
center: true,
|
|
|
|
center: true,
|
|
|
@ -29,6 +37,8 @@ const createWindow = (): void => {
|
|
|
|
|
|
|
|
|
|
|
|
mainWindow.loadURL(webUrl);
|
|
|
|
mainWindow.loadURL(webUrl);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mainWindowState.manage(mainWindow);
|
|
|
|
|
|
|
|
|
|
|
|
if (isDev) {
|
|
|
|
if (isDev) {
|
|
|
|
// Open the DevTools.
|
|
|
|
// Open the DevTools.
|
|
|
|
mainWindow.webContents.openDevTools();
|
|
|
|
mainWindow.webContents.openDevTools();
|
|
|
|