1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

refs #207 Keeps window size

This commit is contained in:
asmsuechan
2017-01-09 01:31:18 +09:00
parent e4212e796a
commit 9179c199fe
2 changed files with 11 additions and 3 deletions

View File

@@ -2,12 +2,18 @@ const electron = require('electron')
const app = electron.app const app = electron.app
const BrowserWindow = electron.BrowserWindow const BrowserWindow = electron.BrowserWindow
const path = require('path') const path = require('path')
const Config = require('electron-config')
const config = new Config()
var showMenu = process.platform !== 'win32' var showMenu = process.platform !== 'win32'
let windowSize = { width: 1080, height: 720 }
var mainWindow = new BrowserWindow({ if(config.get('windowsize') === undefined) config.set('windowsize', windowSize)
width: 1080, windowSize = config.get('windowsize')
height: 720,
let mainWindow = new BrowserWindow({
width: windowSize.width,
height: windowSize.height,
minWidth: 500, minWidth: 500,
minHeight: 320, minHeight: 320,
autoHideMenuBar: showMenu, autoHideMenuBar: showMenu,
@@ -46,6 +52,7 @@ if (process.platform !== 'linux' || process.env.DESKTOP_SESSION === 'cinnamon')
}) })
app.on('before-quit', function (e) { app.on('before-quit', function (e) {
config.set('windowsize', mainWindow.getBounds())
mainWindow.removeAllListeners() mainWindow.removeAllListeners()
}) })
} else { } else {

View File

@@ -49,6 +49,7 @@
"@rokt33r/markdown-it-math": "^4.0.1", "@rokt33r/markdown-it-math": "^4.0.1",
"@rokt33r/season": "^5.3.0", "@rokt33r/season": "^5.3.0",
"codemirror": "^5.19.0", "codemirror": "^5.19.0",
"electron-config": "^0.2.1",
"electron-gh-releases": "^2.0.2", "electron-gh-releases": "^2.0.2",
"font-awesome": "^4.3.0", "font-awesome": "^4.3.0",
"immutable": "^3.8.1", "immutable": "^3.8.1",