Files
netbird/client/ui/icons.go
Zoltan Papp 04b4330393 [client/ui] Add coloured status dot to tray menu
Show a small dot next to the first menu entry that reflects the
daemon state: green for Connected, yellow for Connecting, blue for
NeedsLogin/SessionExpired, red for LoginFailed/Error, grey for
Idle/Disconnected and dark grey for DaemonUnavailable. PNGs are 24x24
with a pHYs chunk declaring 144 DPI so NSImage renders them at 12 pt
while keeping retina-sharp pixel data; circles are supersampled 8x for
smooth edges.

Idle now surfaces as "Disconnected" in the menu label, daemon-status
literals moved to status* constants, and Exit Node / Resources are
gated on the Connected state instead of just daemon availability.
2026-05-12 20:05:50 +02:00

83 lines
2.4 KiB
Go

//go:build !android && !ios && !freebsd && !js
package main
import _ "embed"
// Tray icons embedded from the legacy Fyne UI's asset set. Each pair is a
// light-mode PNG and its dark-mode variant; macOS template variants
// (*-macos.png) live alongside for menubar use. Windows uses the same
// PNGs — multi-resolution .ico files looked promising on disk but
// Wails3's Shell_NotifyIcon NIM_MODIFY never redrew them on the running
// tray; PNG single-frame works.
//go:embed assets/netbird-systemtray-connected.png
var iconConnected []byte
//go:embed assets/netbird-systemtray-connected-dark.png
var iconConnectedDark []byte
//go:embed assets/netbird-systemtray-disconnected.png
var iconDisconnected []byte
//go:embed assets/netbird-systemtray-connecting.png
var iconConnecting []byte
//go:embed assets/netbird-systemtray-error.png
var iconError []byte
//go:embed assets/netbird-systemtray-needs-login.png
var iconNeedsLogin []byte
//go:embed assets/netbird-systemtray-update-connected.png
var iconUpdateConnected []byte
//go:embed assets/netbird-systemtray-update-disconnected.png
var iconUpdateDisconnected []byte
//go:embed assets/netbird-systemtray-connected-macos.png
var iconConnectedMacOS []byte
//go:embed assets/netbird-systemtray-disconnected-macos.png
var iconDisconnectedMacOS []byte
//go:embed assets/netbird-systemtray-connecting-macos.png
var iconConnectingMacOS []byte
//go:embed assets/netbird-systemtray-error-macos.png
var iconErrorMacOS []byte
//go:embed assets/netbird-systemtray-needs-login-macos.png
var iconNeedsLoginMacOS []byte
//go:embed assets/netbird-systemtray-update-connected-macos.png
var iconUpdateConnectedMacOS []byte
//go:embed assets/netbird-systemtray-update-disconnected-macos.png
var iconUpdateDisconnectedMacOS []byte
//go:embed assets/netbird.png
var iconWindow []byte
// Small colored dots shown next to the status menu entry. Rendered as
// regular NSImage/HBITMAP/GTK menu-item icons (not template), so the
// colours stay intact on every platform.
//go:embed assets/netbird-menu-dot-connected.png
var iconMenuDotConnected []byte
//go:embed assets/netbird-menu-dot-connecting.png
var iconMenuDotConnecting []byte
//go:embed assets/netbird-menu-dot-login.png
var iconMenuDotLogin []byte
//go:embed assets/netbird-menu-dot-error.png
var iconMenuDotError []byte
//go:embed assets/netbird-menu-dot-idle.png
var iconMenuDotIdle []byte
//go:embed assets/netbird-menu-dot-offline.png
var iconMenuDotOffline []byte