forked from trazyn/weweChat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
38 lines (29 loc) · 870 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { app, BrowserWindow } from 'electron';
import windowStateKeeper from 'electron-window-state';
let mainWindow;
const createMainWindow = () => {
var mainWindowState = windowStateKeeper({
defaultWidth: 1024,
defaultHeight: 720
});
mainWindow = new BrowserWindow({
width: mainWindowState.width,
hieght: mainWindowState.height,
x: mainWindowState.x,
y: mainWindowState.y,
webPreferences: {
scrollBounce: true
}
});
mainWindowState.manage(mainWindow);
mainWindow.loadURL(`file://${__dirname}/src/index.html`);
mainWindow.webContents.on('did-finish-load', () => {
mainWindow.show();
mainWindow.focus();
});
mainWindow.on('closed', () => {
mainWindow = null;
app.quit();
});
};
app.on('ready', createMainWindow);