mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
Add dummy systray_mac to fix unit tests (#2187)
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user