feat: 替换原生窗口控制栏

This commit is contained in:
digua
2026-01-12 21:57:37 +08:00
parent 1aff2057d7
commit 39238fec32
7 changed files with 176 additions and 10 deletions
+13 -2
View File
@@ -102,7 +102,8 @@ class MainProcess {
// 创建主窗口
async createWindow() {
this.mainWindow = new BrowserWindow({
// 平台差异化窗口配置
const windowOptions: Electron.BrowserWindowConstructorOptions = {
width: 1180,
height: 752,
minWidth: 1180,
@@ -114,7 +115,17 @@ class MainProcess {
sandbox: false,
devTools: true,
},
})
}
// macOS: 使用 hiddenInset 保留红绿灯按钮
// Windows/Linux: 完全移除系统标题栏
if (platform.isMacOS) {
windowOptions.titleBarStyle = 'hiddenInset'
} else {
windowOptions.frame = false
}
this.mainWindow = new BrowserWindow(windowOptions)
this.mainWindow.once('ready-to-show', () => {
this.mainWindow?.show()