提交 08343134 编写于 作者: B Baptiste Augrain

restore window position

上级 79fb0412
......@@ -7,9 +7,11 @@ const config = new Config()
const _ = require('lodash')
var showMenu = process.platform !== 'win32'
const windowSize = config.get('windowsize') || { width: 1080, height: 720 }
const windowSize = config.get('windowsize') || { x: null, y: null, width: 1080, height: 720 }
const mainWindow = new BrowserWindow({
x: windowSize.x,
y: windowSize.y,
width: windowSize.width,
height: windowSize.height,
minWidth: 500,
......@@ -59,6 +61,7 @@ if (process.platform === 'darwin') {
}
mainWindow.on('resize', _.throttle(storeWindowSize, 500))
mainWindow.on('move', _.throttle(storeWindowSize, 500))
function storeWindowSize () {
try {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册