-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
57 lines (46 loc) · 1.09 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
"use strict";
if(require('electron-squirrel-startup')) return;
require('update-electron-app')();
const {app, dialog, nativeImage, shell, Tray, Menu, BrowserWindow} = require("electron");
const notifier = require("node-notifier");
const fs = require('fs');
const path = require('path')
let mainWindow = null
const createWindow = () => {
mainWindow = new BrowserWindow({
width: 400,
height: 300,
//resizable: false,
backgroundColor: "#D6D8DC",
webPreferences: {
nodeIntegration: true,
enableRemoteModule: true
}
});
if (app.dock) { app.dock.show() };
mainWindow.setMenuBarVisibility(false);
mainWindow.loadURL(require('url').format({
pathname: path.join(__dirname, 'index.html'),
protocol: 'file:',
slashes: true
}))
mainWindow.on('close', (event) => {
if (mainWindow != null){
mainWindow.hide();
}
mainWindow = null
});
}
app.on('ready', () => {
createWindow();
})
app.on("before-quit", ev => {
if (mainWindow != null){
mainWindow.close();
}
top = null;
});
app.on('will-quit', ev => {
app.quit();
})
let top = {};