新增窗口大小设置

This commit is contained in:
lyswhut
2019-10-22 01:25:03 +08:00
parent c97bc5edfc
commit 31e8b466cf
13 changed files with 118 additions and 18 deletions
+4 -2
View File
@@ -18,6 +18,7 @@ app.on('second-instance', (event, argv, cwd) => {
require('./events')
const autoUpdate = require('./utils/autoUpdate')
const { isLinux, isMac } = require('../common/utils')
const { getWindowSizeInfo } = require('./utils')
const isDev = process.env.NODE_ENV !== 'production'
@@ -39,13 +40,14 @@ if (isDev) {
}
function createWindow() {
let windowSizeInfo = getWindowSizeInfo()
/**
* Initial window options
*/
mainWindow = global.mainWindow = new BrowserWindow({
height: 590,
height: windowSizeInfo.height,
useContentSize: true,
width: 920,
width: windowSizeInfo.width,
frame: false,
transparent: !isLinux,
// icon: path.join(global.__static, isWin ? 'icons/256x256.ico' : 'icons/512x512.png'),