Add dummy systray_mac to fix unit tests (#2187)

This commit is contained in:
Vadim Shchepotev
2022-12-10 19:57:11 +01:00
committed by GitHub
parent 3f077d9bdb
commit 7a22e0f885
2 changed files with 91 additions and 2 deletions
-2
View File
@@ -1,5 +1,3 @@
//go:build windows
package platform
import (
@@ -0,0 +1,91 @@
//go:build darwin
package systray
import (
"errors"
"github.com/wailsapp/wails/v2/pkg/menu"
"github.com/wailsapp/wails/v2/pkg/options"
)
var NotImplementedSysTray = errors.New("not implemented")
type Systray struct {
}
func (p *Systray) Close() {
err := p.Stop()
if err != nil {
println(err.Error())
}
}
func (p *Systray) Update() error {
return NotImplementedSysTray
}
func (p *Systray) SetTitle(_ string) {}
func New() (*Systray, error) {
return nil, NotImplementedSysTray
}
func (p *Systray) SetMenu(popupMenu *menu.Menu) (err error) {
return NotImplementedSysTray
}
func (p *Systray) Stop() error {
return NotImplementedSysTray
}
func (p *Systray) OnLeftClick(fn func()) {
}
func (p *Systray) OnRightClick(fn func()) {
}
func (p *Systray) OnLeftDoubleClick(fn func()) {
}
func (p *Systray) OnRightDoubleClick(fn func()) {
}
func (p *Systray) OnMenuClose(fn func()) {
}
func (p *Systray) OnMenuOpen(fn func()) {
}
func (p *Systray) SetTooltip(tooltip string) error {
return NotImplementedSysTray
}
func (p *Systray) ShowMessage(title, msg string, bigIcon bool) error {
return NotImplementedSysTray
}
func (p *Systray) Show() error {
return p.setVisible(true)
}
func (p *Systray) Hide() error {
return p.setVisible(false)
}
func (p *Systray) setVisible(visible bool) error {
return NotImplementedSysTray
}
func (p *Systray) SetIcons(lightModeIcon, darkModeIcon *options.SystemTrayIcon) error {
return NotImplementedSysTray
}
func (p *Systray) Run() error {
return NotImplementedSysTray
}