修改logo,修改配置页面的窗口

This commit is contained in:
2026-07-06 20:22:25 +08:00
parent 04d2e6e429
commit 12210423f2
12 changed files with 110 additions and 15 deletions
+7
View File
@@ -1,12 +1,16 @@
package ui
import (
_ "embed"
"lmvpn/internal/i18n"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/driver/desktop"
)
//go:embed tray-icon.png
var trayIconBytes []byte
// setupTray configures the system tray menu (desktop only).
func (a *App) setupTray() {
deskApp, ok := a.fyneApp.(desktop.App)
@@ -44,6 +48,7 @@ func (a *App) setupTray() {
menu := fyne.NewMenu(i18n.T("WindowTitle"),
fyne.NewMenuItem(i18n.T("TrayShowWindow"), func() {
showDockIcon()
a.window.Show()
a.window.RequestFocus()
}),
@@ -62,4 +67,6 @@ func (a *App) setupTray() {
}),
)
deskApp.SetSystemTrayMenu(menu)
trayIcon := fyne.NewStaticResource("tray-icon.png", trayIconBytes)
deskApp.SetSystemTrayIcon(trayIcon)
}