mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
refs #207 Keeps window size
This commit is contained in:
@@ -2,12 +2,18 @@ const electron = require('electron')
|
||||
const app = electron.app
|
||||
const BrowserWindow = electron.BrowserWindow
|
||||
const path = require('path')
|
||||
const Config = require('electron-config')
|
||||
const config = new Config()
|
||||
|
||||
var showMenu = process.platform !== 'win32'
|
||||
let windowSize = { width: 1080, height: 720 }
|
||||
|
||||
var mainWindow = new BrowserWindow({
|
||||
width: 1080,
|
||||
height: 720,
|
||||
if(config.get('windowsize') === undefined) config.set('windowsize', windowSize)
|
||||
windowSize = config.get('windowsize')
|
||||
|
||||
let mainWindow = new BrowserWindow({
|
||||
width: windowSize.width,
|
||||
height: windowSize.height,
|
||||
minWidth: 500,
|
||||
minHeight: 320,
|
||||
autoHideMenuBar: showMenu,
|
||||
@@ -46,6 +52,7 @@ if (process.platform !== 'linux' || process.env.DESKTOP_SESSION === 'cinnamon')
|
||||
})
|
||||
|
||||
app.on('before-quit', function (e) {
|
||||
config.set('windowsize', mainWindow.getBounds())
|
||||
mainWindow.removeAllListeners()
|
||||
})
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user