mirror of
https://github.com/nathanp/crypto-price-widget.git
synced 2025-11-05 18:58:54 -05:00
Updates for windows and mac builds
This commit is contained in:
parent
53bd6af536
commit
fa54efcec6
19
main.js
19
main.js
@ -1,8 +1,7 @@
|
|||||||
const electron = require("electron");
|
const electron = require("electron");
|
||||||
// Module to control application life.
|
// app control, application life.BrowserWindow creates native browser window.
|
||||||
const app = electron.app;
|
const { app, BrowserWindow } = require("electron");
|
||||||
// Module to create native browser window.
|
|
||||||
const BrowserWindow = electron.BrowserWindow;
|
|
||||||
//Store Window size and position
|
//Store Window size and position
|
||||||
const windowStateKeeper = require("electron-window-state");
|
const windowStateKeeper = require("electron-window-state");
|
||||||
|
|
||||||
@ -13,7 +12,7 @@ const settings = require("electron-settings");
|
|||||||
|
|
||||||
// Keep a global reference of the window object, if you don't, the window will
|
// Keep a global reference of the window object, if you don't, the window will
|
||||||
// be closed automatically when the JavaScript object is garbage collected.
|
// be closed automatically when the JavaScript object is garbage collected.
|
||||||
let mainWindow;
|
let mainWindow = null;
|
||||||
|
|
||||||
function createWindow() {
|
function createWindow() {
|
||||||
// Load the previous state with fallback to defaults
|
// Load the previous state with fallback to defaults
|
||||||
@ -22,10 +21,7 @@ function createWindow() {
|
|||||||
defaultHeight: 240,
|
defaultHeight: 240,
|
||||||
});
|
});
|
||||||
// Create the browser window.
|
// Create the browser window.
|
||||||
mainWindow = new electron.BrowserWindow({
|
mainWindow = new BrowserWindow({
|
||||||
webPreferences: {
|
|
||||||
nodeIntegration: true,
|
|
||||||
},
|
|
||||||
title: app.getName(),
|
title: app.getName(),
|
||||||
alwaysOnTop: false,
|
alwaysOnTop: false,
|
||||||
//show: false,
|
//show: false,
|
||||||
@ -42,7 +38,10 @@ function createWindow() {
|
|||||||
titleBarStyle: "customButtonsOnHover",
|
titleBarStyle: "customButtonsOnHover",
|
||||||
autoHideMenuBar: true,
|
autoHideMenuBar: true,
|
||||||
transparent: true,
|
transparent: true,
|
||||||
icon: "images/icon.png",
|
icon: path.join(__dirname, "images/icon.png"),
|
||||||
|
webPreferences: {
|
||||||
|
nodeIntegration: true,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// Let us register listeners on the window, so we can update the state
|
// Let us register listeners on the window, so we can update the state
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
"start": "electron .",
|
"start": "electron .",
|
||||||
"build": "node build.js",
|
"build": "node build.js",
|
||||||
"package-mac": "electron-packager . --overwrite --platform=darwin --arch=x64 --icon=images/icon.icns --prune=true --out=release-builds",
|
"package-mac": "electron-packager . --overwrite --platform=darwin --arch=x64 --icon=images/icon.icns --prune=true --out=release-builds",
|
||||||
"package-win": "electron-packager . --overwrite --asar=true --platform=win32 --arch=ia32 --icon=images/icon_win.ico --prune=true --out=release-builds --version-string.CompanyName=CE --version-string.FileDescription=CE --version-string.ProductName=\"Crypto Price Widget\"",
|
"package-win": "electron-packager . --overwrite --platform=win32 --arch=x64 --icon=images/icon_win.ico --prune=true --out=release-builds --version-string.CompanyName=CE --version-string.FileDescription=CE --version-string.ProductName=\"Crypto Price Widget\"",
|
||||||
"package-linux": "electron-packager . --overwrite --platform=linux --arch=x64 --icon=images/icon.png --prune=true --out=release-builds"
|
"package-linux": "electron-packager . --overwrite --platform=linux --arch=x64 --icon=images/icon.png --prune=true --out=release-builds"
|
||||||
},
|
},
|
||||||
"repository": "https://github.com/nathanp/crypto-price-widget",
|
"repository": "https://github.com/nathanp/crypto-price-widget",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user