5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 17:39:58 +08:00
wails/v2/internal/platform/systray.go
Lea Anthony b84a2e5255
Windows tray menus (#2181)
* Add example

* Add windows systray

* Add gitkeep

* use windows.GUID
2022-12-06 20:55:56 +11:00

34 lines
721 B
Go

//go:build windows
package platform
import (
"github.com/wailsapp/wails/v2/internal/platform/systray"
"github.com/wailsapp/wails/v2/pkg/menu"
"github.com/wailsapp/wails/v2/pkg/options"
)
import "github.com/samber/lo"
type SysTray interface {
// SetTitle sets the title of the tray menu
SetTitle(title string)
SetTooltip(tooltip string) error
Show() error
Hide() error
Run() error
Close()
SetMenu(menu *menu.Menu) error
SetIcons(lightModeIcon, darkModeIcon *options.SystemTrayIcon) error
Update() error
OnLeftClick(func())
OnRightClick(func())
OnLeftDoubleClick(func())
OnRightDoubleClick(func())
OnMenuClose(func())
OnMenuOpen(func())
}
func NewSysTray() SysTray {
return lo.Must(systray.New())
}