2020-11-30 07:48:39 +00:00
|
|
|
const { app, BrowserWindow } = require('electron')
|
|
|
|
const os = require('os');
|
|
|
|
|
|
|
|
function createWindow () {
|
|
|
|
const win = new BrowserWindow({
|
|
|
|
width: 800,
|
2021-06-15 01:29:51 +00:00
|
|
|
height: 600
|
2020-11-30 07:48:39 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
win.loadFile('index.html')
|
|
|
|
}
|
|
|
|
|
|
|
|
app.whenReady().then(() => {
|
|
|
|
const win = new BrowserWindow()
|
|
|
|
|
|
|
|
win.setRepresentedFilename(os.homedir())
|
|
|
|
win.setDocumentEdited(true)
|
|
|
|
})
|
|
|
|
|
|
|
|
app.on('window-all-closed', () => {
|
|
|
|
if (process.platform !== 'darwin') {
|
|
|
|
app.quit()
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
app.on('activate', () => {
|
|
|
|
if (BrowserWindow.getAllWindows().length === 0) {
|
|
|
|
createWindow()
|
|
|
|
}
|
|
|
|
})
|