-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathindex.js
46 lines (38 loc) · 864 Bytes
/
index.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 electron = require('electron');
const path = require('path');
const url = require('url');
require('electron-debug')();
const {
app,
BrowserWindow
} = electron;
let mainWindow;
// 854 x 480
app.on('ready', () => {
mainWindow = new BrowserWindow({
width: 854,
height: 480,
useContentSize: true,
center:true,
show: false,
backgroundColor: '#420024',
title: "Markdown C3",
icon: path.join(__dirname, '/src/icons/icon-256.png')
});
mainWindow.loadURL(url.format({
pathname: path.join(__dirname, 'src', 'index.html'),
protocol: 'file:',
slashes: true
}))
mainWindow.once('ready-to-show', () => {
mainWindow.show();
})
mainWindow.on('closed', () => {
mainWindow = null;
})
});
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})