Migrate to ESM and fix window sizing on Windows
This commit is contained in:
parent
8bc1abb990
commit
ff28d089ba
26
index.js
26
index.js
@ -1,4 +1,17 @@
|
|||||||
const { app, BrowserWindow } = require('electron');
|
import { app, BrowserWindow } from 'electron';
|
||||||
|
|
||||||
|
// A helper function for creating the window
|
||||||
|
const createWindow = () => {
|
||||||
|
const win = new BrowserWindow({
|
||||||
|
width: 290,
|
||||||
|
height: 465,
|
||||||
|
resizable: false,
|
||||||
|
autoHideMenuBar: true,
|
||||||
|
useContentSize: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
win.loadFile('static/index.html');
|
||||||
|
};
|
||||||
|
|
||||||
app.whenReady().then(() => {
|
app.whenReady().then(() => {
|
||||||
createWindow();
|
createWindow();
|
||||||
@ -14,14 +27,3 @@ app.whenReady().then(() => {
|
|||||||
app.on('window-all-closed', () => {
|
app.on('window-all-closed', () => {
|
||||||
if (process.platform !== 'darwin') app.quit();
|
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');
|
|
||||||
}
|
|
@ -3,6 +3,7 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "Prosty kalkulator w Electronie",
|
"description": "Prosty kalkulator w Electronie",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"start": "electron ."
|
"start": "electron ."
|
||||||
|
Loading…
Reference in New Issue
Block a user