-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
39 lines (32 loc) · 855 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
const { app, BrowserWindow } = require('electron');
let _window;
function createWindow () {
// Create the browser window.
this._window = new BrowserWindow({
width: 1200,
height: 800,
backgroundColor: '#FFFFFF',
icon: `file://${__dirname}/dist/assets/logo.png`
});
// Load url
this._window.loadURL(`file://${__dirname}/dist/project/index.html`);
// Event when the window is closed.
this._window.on('closed', function () {
_window = null;
});
}
// Create window on electron intialization
app.on('ready', createWindow);
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// OSX specific close process
if (process.platform !== 'darwin') {
app.quit();
}
});
app.on('activate', function () {
// OSX specific close process
if (_window === null) {
createWindow();
}
});