diff --git a/src/main.js b/src/main.js index 1745f614c..84e757b2d 100644 --- a/src/main.js +++ b/src/main.js @@ -33,6 +33,19 @@ function newWindow(path) { window.show() }) + if (setting.get('window.maximized') === true) { + window.maximize() + } + + // store the window size + window.on('maximize', () => { + setting.set('window.maximized', true) + }) + + window.on('unmaximize', () => { + setting.set('window.maximized', false) + }) + window.on('closed', () => { window = null }) diff --git a/src/setting.js b/src/setting.js index 6c71a2770..7908d9071 100644 --- a/src/setting.js +++ b/src/setting.js @@ -210,7 +210,8 @@ let defaults = { 'window.height': 604, 'window.minheight': 440, 'window.minwidth': 526, - 'window.width': 564 + 'window.width': 564, + 'window.maximized': false } let eventEmitters = {}