mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2025-01-24 07:38:36 +00:00
Implement Electron Window State Manager
This commit is contained in:
parent
c5a76ade59
commit
9ac18e071e
@ -4,6 +4,7 @@
|
|||||||
"description": "Placeholder for the nativefier cli to override with a target url",
|
"description": "Placeholder for the nativefier cli to override with a target url",
|
||||||
"main": "lib/main.js",
|
"main": "lib/main.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"electron-window-state": "^2.0.0",
|
||||||
"wurl": "^2.1.0"
|
"wurl": "^2.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {},
|
"devDependencies": {},
|
||||||
|
@ -8,7 +8,7 @@ var electron = require('electron');
|
|||||||
var createMainWindow = require('./components/mainWindow/mainWindow');
|
var createMainWindow = require('./components/mainWindow/mainWindow');
|
||||||
var createLoginWindow = require('./components/login/loginWindow');
|
var createLoginWindow = require('./components/login/loginWindow');
|
||||||
var helpers = require('./helpers/helpers');
|
var helpers = require('./helpers/helpers');
|
||||||
|
var windowStateKeeper = require('electron-window-state');
|
||||||
var app = electron.app;
|
var app = electron.app;
|
||||||
var ipcMain = electron.ipcMain;
|
var ipcMain = electron.ipcMain;
|
||||||
var isOSX = helpers.isOSX;
|
var isOSX = helpers.isOSX;
|
||||||
@ -47,7 +47,12 @@ app.on('before-quit', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
app.on('ready', function () {
|
app.on('ready', function () {
|
||||||
|
var mainWindowState = windowStateKeeper({
|
||||||
|
defaultWidth: appArgs.width || 1280,
|
||||||
|
defaultHeight: appArgs.height || 800
|
||||||
|
});
|
||||||
mainWindow = createMainWindow(appArgs, app.quit, app.dock.setBadge);
|
mainWindow = createMainWindow(appArgs, app.quit, app.dock.setBadge);
|
||||||
|
mainWindowState.manage(mainWindow);
|
||||||
});
|
});
|
||||||
|
|
||||||
app.on('login', function(event, webContents, request, authInfo, callback) {
|
app.on('login', function(event, webContents, request, authInfo, callback) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user