kalkulator/index.js

27 lines
726 B
JavaScript

const { app, BrowserWindow } = require('electron');
app.whenReady().then(() => {
createWindow();
// This event works on macOS only.
// If the user clicks on app's icon on the dock and there are no open windows, create one.
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) createWindow();
});
});
// If all windows are closed and we're not running macOS, quit the app.
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') app.quit();
});
function createWindow() {
const win = new BrowserWindow({
width: 280,
height: 485,
resizable: false,
autoHideMenuBar: true,
});
win.loadFile('static/index.html');
}