forked from CardiJey/schulrechner
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
34 lines (27 loc) · 792 Bytes
/
Copy pathmain.js
File metadata and controls
34 lines (27 loc) · 792 Bytes
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
const { app, BrowserWindow } = require('electron');
const path = require('path');
let mainWindow;
app.whenReady().then(() => {
mainWindow = new BrowserWindow({
height: 600,
width: 300,
minWidth: 300,
minHeight: 600,
webPreferences: {
nodeIntegration: true, // Allow Node.js integration
contextIsolation: false,
}
});
if(app.isPackaged){
const { Menu } = require('electron');
Menu.setApplicationMenu(null);
}
mainWindow.setAspectRatio(1 / 2);
mainWindow.loadFile(path.join(__dirname, 'www', 'index.html'));
mainWindow.on('closed', () => {
mainWindow = null;
});
});
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') app.quit();
});