Files
netbird/client/ui/icons_menu_darwin.go
T
Zoltán Papp 8d4f35352f skip About-row brand mark on macOS
NSMenuItem.setImage stretches the row to the leading image's pixel
size regardless of the surrounding rows, so any non-empty bitmap on
the About entry made it visibly taller than the rest of the tray
menu — leaving 16, 18 or 22 px versions all looking wrong next to
the unadorned rows above and below.

Drop the macOS brand mark and gate the SetBitmap call on a non-empty
byte slice; iconMenuNetbird is now nil on macOS, so the About row
falls back to text only. Windows and Linux still ship the brand mark
through their per-platform embed files.
2026-05-21 17:01:08 +02:00

42 lines
1.4 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//go:build darwin
package main
import _ "embed"
// 22x22 status dot icons used on macOS. Apple's HIG recommends an
// 18–22 px glyph for NSMenuItem leading images; 22 matches the visual
// weight of the surrounding row text. Windows ships a 16x16 variant
// (Win32 SM_CXMENUCHECK slot) and Linux a 24x24 variant (GTK menu row
// supports the larger range) — see the sibling icons_menu_*.go files.
//
// iconMenuNetbird is intentionally empty on macOS. NSMenuItem.setImage
// stretches the row height to the leading image's pixel size, which
// makes the About row taller than the unadorned rows above and below
// it regardless of the PNG size we ship. The brand mark is rendered
// only on Windows and Linux (see those platforms' icons_menu_*.go
// files); on macOS the About row stays text-only — the tray icon
// itself already supplies the brand presence.
//
// Status dots are downscaled from the 24x24 originals with ImageMagick.
var iconMenuNetbird []byte
//go:embed assets/netbird-menu-dot-connected-22.png
var iconMenuDotConnected []byte
//go:embed assets/netbird-menu-dot-connecting-22.png
var iconMenuDotConnecting []byte
//go:embed assets/netbird-menu-dot-login-22.png
var iconMenuDotLogin []byte
//go:embed assets/netbird-menu-dot-error-22.png
var iconMenuDotError []byte
//go:embed assets/netbird-menu-dot-idle-22.png
var iconMenuDotIdle []byte
//go:embed assets/netbird-menu-dot-offline-22.png
var iconMenuDotOffline []byte