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
6 changed files with 19 additions and 16 deletions
+1 -1
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
-6
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
}
+12
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
}
@@ -5,4 +5,8 @@ package main
import _ "embed"
//go:embed icon.ico
var iconData []byte
var iconICO []byte
func getIcon() []byte {
return iconICO
}
@@ -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)
-8
View File
@@ -1,8 +0,0 @@
//go:build !windows
package main
import _ "embed"
//go:embed icon.png
var iconData []byte