Feat: implement window controls overlay

This commit is contained in:
Evan / Fero
2023-07-13 23:53:33 -07:00
parent e7f7d9b024
commit 2f1c388a8b
7 changed files with 61 additions and 27 deletions

View File

@@ -94,12 +94,21 @@ export class Window {
} else {
if (process.platform === 'darwin') {
bwOptions.titleBarStyle = 'hidden'
// If not macOS and native appearance is not toggled, use WCO.
} else {
bwOptions.titleBarStyle = 'hidden',
bwOptions.titleBarOverlay = {
color: '#00000000',
symbolColor: '#ffffff',
height: 32,
}
}
}
if (process.platform === 'darwin') {
this.window = new BrowserWindow(bwOptions) as GlasstronWindow
} else {
// this.window = new BrowserWindow(bwOptions) as GlasstronWindow
this.window = new glasstron.BrowserWindow(bwOptions)
}
@@ -186,6 +195,7 @@ export class Window {
} catch (error) {
console.error('Failed to set window blur', error)
}
// }
} else {
DwmEnableBlurBehindWindow(this.window.getNativeWindowHandle(), enabled)
}