-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
32 lines (23 loc) · 916 Bytes
/
Copy pathindex.js
File metadata and controls
32 lines (23 loc) · 916 Bytes
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
const {app, BrowserWindow} = require('electron')
const config = require('./settings.json')
//global vars
let win
app.on('ready', createWindow)
//Creates the browser window
function createWindow () {
//If debug is enabled make the browser window bigger to allow for dev tools
if (config.debug) {browserWidth = 750} else {browserWidth = 500}
// Create the browser window.
win = new BrowserWindow({width: browserWidth, height: 800})
// and load the index.html of the app.
win.loadFile('index.html')
// Open the DevTools.
if (config.debug) {win.webContents.openDevTools()}
// Emitted when the window is closed.
win.on('closed', () => {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
win = null
})
}