-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
66 lines (53 loc) · 1.37 KB
/
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
const { app, BrowserWindow, Menu, ipcMain } = require('electron');
let mainWindow;
let devWindow;
app.on('ready', () => {
mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
contextIsolation: true,
nodeIntegration: false,
preload: __dirname + '/preload.js',
},
menuBarVisible: false,
titleBarStyle: 'hidden',
...(process.platform !== 'darwin' ? { titleBarOverlay: true } : {})
});
mainWindow.setTitleBarOverlay({
color: 'rgba(0, 0, 0, 0)', // Transparent background
symbolColor: 'rgba(205, 214, 244, 1)', // Symbol color
height: 48
});
mainWindow.setMinimumSize(950, 600);
Menu.setApplicationMenu(null);
mainWindow.loadFile('index.html');
mainWindow.on('closed', () => {
app.quit();
});
ipcMain.on('open-dev-window', () => {
createDevWindow();
});
});
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') app.quit();
});
if (require('electron-squirrel-startup')) app.quit();
function createDevWindow() {
if (devWindow) {
devWindow.focus();
return;
}
devWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true,
},
title: "Iota's Notepad - Developer Options"
});
devWindow.loadFile('developer-options.html');
devWindow.on('closed', () => {
devWindow = null;
});
}