mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
Merge pull request #1985 from wj-xiao/refactor/split-systray
refactor(web): split systray platform build files
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
//go:build !windows
|
||||
|
||||
package main
|
||||
|
||||
import _ "embed"
|
||||
|
||||
//go:embed icon.png
|
||||
var iconData []byte
|
||||
Reference in New Issue
Block a user