Clicking the icon lit it for a moment and put it out again: Wails sends the action on mouse-down, and the button's own tracking takes the highlight off on mouse-up, so it never stayed on while the panel was open, as other apps' items do. Lighting it from the panel's show alone still flickered (lit on press, out on release, lit again). mpOwnClicks (a local event monitor, installed once) now hands a left click on magpie's item to its action and swallows the mouse-down, so the button never tracks it; mpHighlight lights it when the panel shows and puts it out when it hides (events.Mac.WindowShow/WindowHide, hooked in makePanel, so a panel made again after lightweight mode has them too). Right clicks keep Wails' path and its native menu highlight. Linux and Windows get no-ops. go build (darwin app, GOOS=linux -tags nogui, GOOS=windows), go vet ./internal/gui and go test ./internal/gui pass. No automated test: it needs a live status item. To check by hand: a click lights it once and it stays lit; click again, a click elsewhere or Escape puts it out; right click still opens the menu, highlighted.
17 lines
341 B
Go
17 lines
341 B
Go
//go:build !darwin || !cgo
|
|
|
|
package gui
|
|
|
|
// Only the Mac's menu bar draws the cards as an image (trayimage_darwin.go);
|
|
// other trays show the text.
|
|
|
|
func trayImageShow([]trayCell, []byte) bool { return false }
|
|
|
|
func trayImageFrame([]byte) bool { return false }
|
|
|
|
func trayImageHide() {}
|
|
|
|
func trayHighlight(bool) {}
|
|
|
|
func trayOwnClicks() {}
|