-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
73 lines (61 loc) · 1.51 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
67
68
69
70
71
72
73
const electron = require("electron");
const {
app,
BrowserWindow,
Menu,
ipcMain,
dialog
} = electron;
const url = require("url");
let mainWindow;
let newProjectWindow;
app.on("ready", function () {
mainWindow = new BrowserWindow({
width: 1000,
height: 700,
minWidth: 1000,
minHeight: 700,
webPreferences: {
nodeIntegration: true
}
});
mainWindow.loadURL(url.format({
pathname: require("path").join(__dirname, "views", "homeWindow.html"),
protocol: "file",
slashes: true
}));
mainWindow.setMenuBarVisibility(null);
});
ipcMain.on("home:newProject", function () {
newProject();
});
ipcMain.on("newProject:createProject", function () {
projectWindowOpen();
});
function newProject() {
newProjectWindow = new BrowserWindow({
width: 500,
height: 500,
minWidth: 500,
minHeight: 500,
maxHeight: 500,
maxWidth: 500,
webPreferences: {
nodeIntegration: true
}
});
newProjectWindow.loadURL(url.format({
pathname: require("path").join(__dirname, "views", "newProject.html"),
protocol: "file",
slashes: true
}));
newProjectWindow.setMenuBarVisibility(null);
}
function projectWindowOpen() {
mainWindow.loadURL(url.format({
pathname: require("path").join(__dirname, "views", "projectWindow.html"),
protocol: "file",
slashes: true
}));
newProjectWindow.close()
}