为 Windows 平台添加沉浸式标题栏 (#277)

This commit is contained in:
Mr. Will 2021-02-12 12:03:01 +00:00 committed by GitHub
parent c0c4597cd8
commit 51fc57efe8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 147 additions and 2 deletions

View file

@ -88,15 +88,20 @@ class Background {
createWindow() {
console.log("creating app window");
// Only for Windows, a special title bar for it
const withoutFrame = process.platform == "win32";
this.window = new BrowserWindow({
width: this.store.get("window.width") | 1440,
height: this.store.get("window.height") | 840,
minWidth: 1080,
minHeight: 720,
minWidth: 360,
minHeight: 240,
titleBarStyle: "hiddenInset",
frame: !withoutFrame,
webPreferences: {
webSecurity: false,
nodeIntegration: true,
enableRemoteModule: true,
},
});