-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
35 lines (27 loc) · 788 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
//create window
const {app, BrowserWindow} = require('electron')
let mainWindow
function createWindow () {
let mainWindow = new BrowserWindow({titleBarAppearsTransparent: true, fullscreen: true, darkTheme: true, }); //define the presets for mainWindow
mainWindow.show()//show mainWindow
//open devTools
// mainWindow.openDevTools()
//load the index.html file into the window
mainWindow.loadFile('index.html')
mainWindow.on('closed', function () {
//Terminate the window on closed
mainWindow = null
})
}
app.on('ready', createWindow)
//quit when all windows are closed
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function (){
if (mainWindow === null) {
createWindow()
}
})