Merge pull request #1985 from wj-xiao/refactor/split-systray

refactor(web): split systray platform build files
This commit is contained in:
taorye 2026-03-25 14:25:21 +08:00 committed by GitHub
commit aa9bd69f6e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 19 additions and 16 deletions

View file

@ -98,7 +98,7 @@ func main() {
defer logger.DisableFileLogging()
}
logger.InfoC("web", "PicoClaw Launcher starting...")
logger.InfoC("web", fmt.Sprintf("%s Launcher %s starting...", appName, appVersion))
logger.InfoC("web", fmt.Sprintf("PicoClaw Home: %s", picoHome))
// Set language from command line or auto-detect

View file

@ -3,7 +3,6 @@
package main
import (
_ "embed"
"fmt"
"fyne.io/systray"
@ -93,8 +92,3 @@ func onReady() {
func onExit() {
logger.Info(T(Exiting))
}
// getIcon returns the system tray icon
func getIcon() []byte {
return iconData
}

View file

@ -0,0 +1,12 @@
//go:build !windows && ((!darwin && !freebsd) || cgo)
package main
import _ "embed"
//go:embed icon.png
var iconPNG []byte
func getIcon() []byte {
return iconPNG
}

View file

@ -5,4 +5,8 @@ package main
import _ "embed"
//go:embed icon.ico
var iconData []byte
var iconICO []byte
func getIcon() []byte {
return iconICO
}

View file

@ -13,6 +13,7 @@ import (
"github.com/sipeed/picoclaw/pkg/logger"
)
// runTray falls back to a headless mode on platforms where systray requires cgo.
func runTray() {
logger.Infof("System tray is unavailable in %s builds without cgo; running without tray", runtime.GOOS)

View file

@ -1,8 +0,0 @@
//go:build !windows
package main
import _ "embed"
//go:embed icon.png
var iconData []byte