Simplified electron main.js
This commit is contained in:
parent
3842e84d5c
commit
b6d95a6edc
19
main.js
19
main.js
@ -1,22 +1,23 @@
|
|||||||
const {app, BrowserWindow, Menu} = require('electron');
|
const {app, BrowserWindow, Menu, nativeImage} = require('electron');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const url = require('url');
|
const url = require('url');
|
||||||
|
|
||||||
let win;
|
let win;
|
||||||
|
|
||||||
function createWindow() {
|
function createWindow() {
|
||||||
win = new BrowserWindow({width: 1000, height: 800, icon: path.join(__dirname, 'assets/img/logo.png')});
|
let image = nativeImage.createFromPath('assets/img/logo.png');
|
||||||
|
|
||||||
|
win = new BrowserWindow({
|
||||||
|
width: 1000,
|
||||||
|
height: 800,
|
||||||
|
icon: image,
|
||||||
|
title: 'Formula Manager 2.0'
|
||||||
|
});
|
||||||
|
|
||||||
Menu.setApplicationMenu(null);
|
Menu.setApplicationMenu(null);
|
||||||
|
|
||||||
// load the dist folder from Angular
|
// load the dist folder from Angular
|
||||||
win.loadURL(
|
win.loadURL('https://fhsons.zakscode.com/formulaManager');
|
||||||
url.format({
|
|
||||||
pathname: path.join(__dirname, 'public/index.html'),
|
|
||||||
protocol: 'file:',
|
|
||||||
slashes: true
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
// Open the DevTools optionally:
|
// Open the DevTools optionally:
|
||||||
win.webContents.openDevTools();
|
win.webContents.openDevTools();
|
||||||
|
Loading…
Reference in New Issue
Block a user