-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathmain.js
40 lines (32 loc) · 861 Bytes
/
main.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
39
40
const {app, BrowserWindow, dialog} = require('electron');
const windowStateKeeper = require('electron-window-state');
let win;
app.on('window-all-closed', function() {
app.quit();
});
let quitApp = function(){ app.quit() }
app.on('ready', function() {
var size = { width: 400, height: 500 };
let winState = windowStateKeeper({
defaultWidth: size.width,
defaultHeight: size.height
});
win = new BrowserWindow({
// Min size
minWidth: size.width,
minHeight: size.height,
// Window style
transparent: true,
frame: false,
radii: [10,10,10,10],
// Window state
x: winState.x,
y: winState.y,
icon: __dirname + '/images/icon.png',
width: winState.width,
height: winState.height
});
win.loadURL('file://' + __dirname + '/index.html');
// win.openDevTools();
winState.manage(win);
});