-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Files
/
Copy pathabout.js
51 lines (43 loc) · 980 Bytes
1
const about = module.exports = {
2
init,
3
4
5
win: null
}
6
7
const config = require('../../config')
const electron = require('electron')
8
9
function init () {
10
if (about.win) {
11
return about.win.show()
12
13
}
14
const win = about.win = new electron.BrowserWindow({
15
16
17
18
19
20
21
22
23
24
backgroundColor: '#ECECEC',
center: true,
fullscreen: false,
height: 170,
icon: getIconPath(),
maximizable: false,
minimizable: false,
resizable: false,
show: false,
skipTaskbar: true,
25
title: 'About ' + config.APP_WINDOW_TITLE,
26
useContentSize: true,
27
28
29
webPreferences: {
nodeIntegration: true
},
30
31
32
33
34
35
36
37
width: 300
})
win.loadURL(config.WINDOW_ABOUT)
// No menu on the About window
win.setMenu(null)
38
win.once('ready-to-show', function () {
39
40
41
42
43
44
45
46
47
48
49
50
51
win.show()
})
win.once('closed', function () {
about.win = null
})
}
function getIconPath () {
return process.platform === 'win32'
? config.APP_ICON + '.ico'
: config.APP_ICON + '.png'
}