mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
Merge pull request #221 from asmsuechan/remember-window-size
refs #207 Keeps window size
This commit is contained in:
@@ -2,12 +2,15 @@ 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 = config.get('windowsize') || { width: 1080, height: 720 }
|
||||
|
||||
var mainWindow = new BrowserWindow({
|
||||
width: 1080,
|
||||
height: 720,
|
||||
let mainWindow = new BrowserWindow({
|
||||
width: windowSize.width,
|
||||
height: windowSize.height,
|
||||
minWidth: 500,
|
||||
minHeight: 320,
|
||||
autoHideMenuBar: showMenu,
|
||||
@@ -46,6 +49,7 @@ if (process.platform !== 'linux' || process.env.DESKTOP_SESSION === 'cinnamon')
|
||||
})
|
||||
|
||||
app.on('before-quit', function (e) {
|
||||
config.set('windowsize', mainWindow.getBounds())
|
||||
mainWindow.removeAllListeners()
|
||||
})
|
||||
} else {
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
"@rokt33r/markdown-it-math": "^4.0.1",
|
||||
"@rokt33r/season": "^5.3.0",
|
||||
"codemirror": "^5.19.0",
|
||||
"electron-config": "^0.2.1",
|
||||
"electron-gh-releases": "^2.0.2",
|
||||
"flowchart.js": "^1.6.5",
|
||||
"font-awesome": "^4.3.0",
|
||||
|
||||
Reference in New Issue
Block a user