⬆️ Upgrade wails v3 from Alpha 9 to Alpha 10

This commit is contained in:
2025-07-10 10:01:52 +08:00
parent b52e067d50
commit 4d62da912a
42 changed files with 1220 additions and 511 deletions

View File

@@ -7,14 +7,14 @@ import (
// TrayService 系统托盘服务
type TrayService struct {
logger *log.LoggerService
logger *log.Service
configService *ConfigService
app *application.App
mainWindow *application.WebviewWindow
}
// NewTrayService 创建新的系统托盘服务实例
func NewTrayService(logger *log.LoggerService, configService *ConfigService) *TrayService {
func NewTrayService(logger *log.Service, configService *ConfigService) *TrayService {
return &TrayService{
logger: logger,
configService: configService,
@@ -42,7 +42,7 @@ func (ts *TrayService) HandleWindowClose() {
if ts.ShouldMinimizeToTray() {
// 隐藏到托盘
ts.mainWindow.Hide()
ts.app.EmitEvent("window:hidden", nil)
ts.app.Event.Emit("window:hidden", nil)
} else {
// 直接退出应用
ts.app.Quit()
@@ -54,7 +54,7 @@ func (ts *TrayService) HandleWindowMinimize() {
if ts.ShouldMinimizeToTray() {
// 隐藏到托盘
ts.mainWindow.Hide()
ts.app.EmitEvent("window:hidden", nil)
ts.app.Event.Emit("window:hidden", nil)
}
}
@@ -65,7 +65,7 @@ func (ts *TrayService) ShowWindow() {
ts.mainWindow.Restore()
ts.mainWindow.Focus()
if ts.app != nil {
ts.app.EmitEvent("window:shown", nil)
ts.app.Event.Emit("window:shown", nil)
}
}
}