mirror of
https://github.com/SECTL/SecScore.git
synced 2026-07-21 18:19:03 +08:00
feat(窗口管理): 添加系统托盘功能并优化窗口关闭行为
- 新增 TrayService 实现系统托盘功能 - 主窗口关闭时默认隐藏而非退出 - 添加 window_zoom 配置项支持窗口缩放 - 引入 TrayServiceToken 作为依赖注入标识 - 通过 isQuitting 状态控制应用退出行为
This commit is contained in:
@@ -76,6 +76,14 @@ export class WindowManager extends Service {
|
||||
win.webContents.setZoomFactor(zoom)
|
||||
|
||||
this.windows.set(input.key, win)
|
||||
|
||||
win.on('close', (event) => {
|
||||
if (!this.mainCtx.isQuitting && input.key === 'main') {
|
||||
event.preventDefault()
|
||||
win.hide()
|
||||
}
|
||||
})
|
||||
|
||||
win.on('closed', () => {
|
||||
this.windows.delete(input.key)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user