diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2017-02-20 11:03:02 -0500 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2017-02-20 11:03:02 -0500 |
| commit | dbfa41acbdcb8ea1e58ac38455f61d6b2a91e008 (patch) | |
| tree | 9a68b258c5e1a21d5f0f87d6d6dccd4b3478f6cb /electron_js | |
| parent | c50c77f5abc3b2977a3357ec21a9417ed97442fa (diff) | |
desktop window state should now be remembered #462
Diffstat (limited to 'electron_js')
| -rw-r--r-- | electron_js/main.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/electron_js/main.js b/electron_js/main.js index 2e6941cf..7f3a955b 100644 --- a/electron_js/main.js +++ b/electron_js/main.js @@ -1,4 +1,5 @@ const electron = require('electron'); +const windowStateKeeper = require('electron-window-state'); //require('electron-debug')({showDevTools: true}); // Module to control application life. const {app} = electron; @@ -26,8 +27,19 @@ if (shouldQuit) { function createWindow() { // Create the browser window. - win = new BrowserWindow({width: 1024, height: 900, webPreferences:{nodeIntegration:false}}); + let mainWindowState = windowStateKeeper({ + defaultWidth: 1000, + defaultHeight: 800 + }); + //win = new BrowserWindow({width: 1024, height: 900, webPreferences:{nodeIntegration:false}}); + win = new BrowserWindow({ + x: mainWindowState.x, + y: mainWindowState.y, + width: mainWindowState.width, + height: mainWindowState.height, + webPreferences:{nodeIntegration:false}}); + mainWindowState.manage(win); // fs will be arg 1 if its not run in electron debug mode if (process.argv.slice(1)=='fs' || process.argv.slice(2)=='fs') win.setFullScreen(true); |
