mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
restore window position
This commit is contained in:
@@ -7,9 +7,11 @@ const config = new Config()
|
|||||||
const _ = require('lodash')
|
const _ = require('lodash')
|
||||||
|
|
||||||
var showMenu = process.platform !== 'win32'
|
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({
|
const mainWindow = new BrowserWindow({
|
||||||
|
x: windowSize.x,
|
||||||
|
y: windowSize.y,
|
||||||
width: windowSize.width,
|
width: windowSize.width,
|
||||||
height: windowSize.height,
|
height: windowSize.height,
|
||||||
minWidth: 500,
|
minWidth: 500,
|
||||||
@@ -59,6 +61,7 @@ if (process.platform === 'darwin') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mainWindow.on('resize', _.throttle(storeWindowSize, 500))
|
mainWindow.on('resize', _.throttle(storeWindowSize, 500))
|
||||||
|
mainWindow.on('move', _.throttle(storeWindowSize, 500))
|
||||||
|
|
||||||
function storeWindowSize () {
|
function storeWindowSize () {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user