mirror of
https://github.com/AynaLivePlayer/AynaLivePlayer.git
synced 2025-12-08 03:12:50 +08:00
update
This commit is contained in:
31
playground/jpgbug/main.go
Normal file
31
playground/jpgbug/main.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/app"
|
||||
"fyne.io/fyne/v2/driver/desktop"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
)
|
||||
|
||||
func main() {
|
||||
a := app.New()
|
||||
w := a.NewWindow("SysTray")
|
||||
|
||||
//icon, _ := fyne.LoadResourceFromPath("./assets/icon.jpg")
|
||||
icon, _ := fyne.LoadResourceFromPath("./assets/icon.png")
|
||||
|
||||
if desk, ok := a.(desktop.App); ok {
|
||||
m := fyne.NewMenu("MyApp",
|
||||
fyne.NewMenuItem("Show", func() {
|
||||
w.Show()
|
||||
}))
|
||||
desk.SetSystemTrayMenu(m)
|
||||
desk.SetSystemTrayIcon(icon)
|
||||
}
|
||||
|
||||
w.SetContent(widget.NewLabel("Fyne System Tray"))
|
||||
w.SetCloseIntercept(func() {
|
||||
w.Hide()
|
||||
})
|
||||
w.ShowAndRun()
|
||||
}
|
||||
Reference in New Issue
Block a user