⬆️ Upgrade wails v3 from Alpha 9 to Alpha 10
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user