mirror of
https://github.com/ILoveBingLu/CipherTalk.git
synced 2026-05-15 08:28:52 +08:00
feat: 更新窗口关闭行为,支持托盘最小化并修复布局样式
This commit is contained in:
+10
-3
@@ -243,18 +243,25 @@ function createWindow() {
|
||||
|
||||
// 获取关闭行为配置
|
||||
const closeToTray = configService?.get('closeToTray')
|
||||
|
||||
|
||||
// 如果配置为关闭到托盘(默认为 true)
|
||||
if (closeToTray !== false) {
|
||||
event.preventDefault()
|
||||
win.hide()
|
||||
|
||||
|
||||
// 确保托盘已创建
|
||||
if (!tray) {
|
||||
createTray()
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
// 否则允许窗口关闭,应用退出
|
||||
|
||||
// 配置为直接退出时,需要显式退出应用。
|
||||
// 否则主窗口关闭后托盘仍然存在,进程不会真正结束。
|
||||
event.preventDefault()
|
||||
app.isQuitting = true
|
||||
app.quit()
|
||||
})
|
||||
|
||||
// 开发环境加载 vite 服务器
|
||||
|
||||
Reference in New Issue
Block a user