-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
47 lines (37 loc) · 965 Bytes
/
app.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
41
42
43
44
45
46
const {app, BrowserWindow} = require('electron');
let mainWindow;
function createWindow() {
//define the app window settings
mainWindow = new BrowserWindow({
width: 600,
height: 600,
title: 'ColorGRID',
resizable: false,
//frame: false,
backgroundColor: "#111",
icon: __dirname + '/app/assets/icon.png',
});
//remove app menu
mainWindow.setMenuBarVisibility(false);
//open the dev tools for debug
//mainWindow.webContents.openDevTools();
//load the app page
mainWindow.loadFile('app.html');
//trigger when window is closed
mainWindow.on('closed', () => {
mainWindow = null;
});
}
//create the window when ready
app.on('ready', createWindow);
//quit
app.on('window-all-closed', () => {
if(process.platform !== 'darwin') {
app.quit();
}
});
app.on('active', () => {
if(mainWindow === null){
createWindow();
}
});