-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.js
57 lines (46 loc) · 1.52 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
const { app, BrowserWindow, ipcMain, Menu, nativeTheme } = require("electron");
require("@electron/remote/main").initialize();
const fs = require("fs");
nativeTheme.themeSource = "dark";
function createWindow() {
var mainWindow = new BrowserWindow({
width: 1400,
height: 800,
backgroundColor: "#222222",
webPreferences: {
nodeIntegration: true,
enableRemoteModule: true,
contextIsolation: false,
webviewTag: true,
devTools: false
},
icon: "appwindow/icon.png",
});
mainWindow.setMenuBarVisibility(false);
mainWindow.loadFile("appwindow/index.html");
require("@electron/remote/main").enable(mainWindow.webContents);
ipcMain.on("updateappsettings", function(data) {
mainWindow.webContents.send("updateappsettings");
});
}
app.whenReady().then(function() {
createWindow();
});
app.on("window-all-closed", function() { app.quit(); });
ipcMain.on("opensettingswin", function(data) {
var settingsWin = new BrowserWindow({
height: 555,
width: 400,
backgroundColor: "#222222",
resizable: false,
webPreferences: {
devTools: false,
nodeIntegration: true,
enableRemoteModule: true,
contextIsolation: false
}
});
settingsWin.setMenuBarVisibility(false);
settingsWin.loadFile(__dirname + "/appwindow/settings/index.html");
require("@electron/remote/main").enable(settingsWin.webContents);
});