mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-16 11:15:12 +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 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 = config.get('windowsize') || { width: 1080, height: 720 }
|
||||||
|
|
||||||
var mainWindow = new BrowserWindow({
|
let mainWindow = new BrowserWindow({
|
||||||
width: 1080,
|
width: windowSize.width,
|
||||||
height: 720,
|
height: windowSize.height,
|
||||||
minWidth: 500,
|
minWidth: 500,
|
||||||
minHeight: 320,
|
minHeight: 320,
|
||||||
autoHideMenuBar: showMenu,
|
autoHideMenuBar: showMenu,
|
||||||
@@ -46,6 +49,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 {
|
||||||
|
|||||||
@@ -47,6 +47,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",
|
||||||
"flowchart.js": "^1.6.5",
|
"flowchart.js": "^1.6.5",
|
||||||
"font-awesome": "^4.3.0",
|
"font-awesome": "^4.3.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user