Files
magpie/internal/gui/traytip_other.go
T
yetone 49d60394ef gui: the Mac's menu bar item shows its tooltip, which Wails never set there (NextCommit on Discord)
NextCommit (macOS, 0.1.1244) hovered the menu bar item for today's
tokens split into input, output and cache and saw nothing. Nothing was
shown at all: Wails v3.0.0-beta.24's macosSystemTray.setTooltip is a
no-op ("Tooltips not supported on macOS"), so neither the idle tip nor a
card's tooltip (usage:today already said "6.3M tokens (912K in · 318K
out · 5.1M cached)") ever reached a Mac. Linux has its own setTrayTip
(SNI); Windows keeps Wails'.

setTrayTip on the Mac now sets the status item's button toolTip on the
main queue (trayTipNative, mpTip in trayimage_darwin.go), returning false
while the item isn't up yet so it is tried again, as Linux's does.

Run: TestMacTrayTipIsSet (darwin, cgo): setTrayTip reaches the native
setter, false before the item is up, and a real NSStatusBarButton keeps a
multi-line tip whole. go vet: darwin (cgo, GUI) and -tags nogui for
darwin, linux and windows. Not tried: hovering the icon in a built app.

Full suite: SUITE_LINE
2026-10-15 23:08:01 +08:00

23 lines
919 B
Go

//go:build !linux && !nogui
package gui
import "github.com/wailsapp/wails/v3/pkg/application"
// setTrayTip: Wails' SetTooltip does it on Windows; on the Mac, where it
// does nothing, the tooltip is set on the item's button itself
// (trayTipNative), or no hover there ever showed the totals or the quotas
// (NextCommit on Discord).
func setTrayTip(_ *application.SystemTray, tip string) bool { return trayTipNative(tip) }
// setTrayPassive: only Linux has Omarchy's bar to put the icon in instead.
func setTrayPassive(*application.SystemTray, bool) bool { return true }
// trayClick: Wails places the panel by the click itself here.
func trayClick(*application.SystemTray) (int, bool) { return 0, false }
// traySchemeLight, watchTrayScheme: only Linux's tray takes the bird in a
// colour of the desktop's (linuxTrayIcon).
func traySchemeLight() bool { return false }
func watchTrayScheme(func(bool)) {}