refactor(app): 优化系统托盘相关代码

- 移除了 systray.Run 函数的冗余 goroutine
- 删除了多余的空行,提高了代码可读性
This commit is contained in:
spark 2025-01-15 13:01:12 +08:00
parent c9a8192d60
commit 97b5faee4a

3
app.go
View File

@ -41,7 +41,7 @@ func (a *App) startup(ctx context.Context) {
a.ctx = ctx
// 创建系统托盘
go systray.Run(func() {
systray.Run(func() {
onReady(a)
}, func() {
onExit(a)
@ -430,7 +430,6 @@ func onReady(a *App) {
systray.SetIcon(icon2)
systray.SetTitle("go-stock")
systray.SetTooltip("go-stock 股票行情实时获取")
// 创建菜单项
show := systray.AddMenuItem("显示", "显示应用程序")
//hide := systray.AddMenuItem("隐藏", "隐藏应用程序")