From b6d20edfeb9076b63fb4f1ca00c30e2f1b3e3bdc Mon Sep 17 00:00:00 2001 From: Zoltan Papp Date: Tue, 26 May 2026 11:33:57 +0200 Subject: [PATCH] tray: show NetBird brand mark next to About on macOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NSMenuItem rejected the dedicated netbird-menu-24.png brand mark (rendered muddy) and the full 256x256 brand PNG (stretched the row). Ship an 18x18 sips-downscale of assets/netbird.png — same source the legacy Fyne client used for its About row — to sit visually alongside the cap-height of the surrounding text. --- client/ui/assets/netbird-menu-about-18.png | Bin 0 -> 838 bytes client/ui/icons_menu_darwin.go | 17 ++++++++--------- client/ui/tray.go | 8 ++++---- 3 files changed, 12 insertions(+), 13 deletions(-) create mode 100644 client/ui/assets/netbird-menu-about-18.png diff --git a/client/ui/assets/netbird-menu-about-18.png b/client/ui/assets/netbird-menu-about-18.png new file mode 100644 index 0000000000000000000000000000000000000000..bb12c6367f9673b0723b6db40818e41a43d24c11 GIT binary patch literal 838 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@Rf|mUKs7M+SzC{oH>NS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fF5l&DCJ@J#ddWzYh$IT%If%U}(=|V1cUf1JWSi0mL9Z5Sn=bBUCj|YylHowa@}) z1RJDnrCM7Okm4-xh%9Dc;1&j9Muu5)Bp4W&EIeHtLo5W(2HR$cIEvKer+wR0-FY%I zNP<<+MZkKakZ1O4j*Y^XZrofVsArgXQEh5(>)NS|x;bk@ws2+q@nm9jc2H`n-+83s z-TgB*_ustLlfIlWy?ncQ{=Mq^=J)rRvv0W1^WXi#`EM%|>o-)&@Ko$#U^~?{qN%PR?;v zZYzDV@sB%ai^bOYOsdaf9Ar4|*ZWS{H^b!_>!v9#!bfg79a-+)$-1#q_g7;=tawB~ zrdLtV12ez9Kc6N2+`0B!kb82O>a{OgAF6_4+O`S!99jLjT;fEFU+DZK)0wdux8Brw z#w=i9TQ+^aK+1IC-0&K;#Zy>IBtpYPj=Xquho8l;^&!{$s<3HKcRxG(ly}0TptQ`; zGK;BGQ;(j?{S?gExwXG(=F#O}-{>h#|8ToI`}DyEV?8S#n=M zedo=+r=L$_YLK~ElRKM_h}%XV|4{ieeyzdp b>pz)Ul%Kp@p#5<>D1mvp`njxgN@xNArAI%^ literal 0 HcmV?d00001 diff --git a/client/ui/icons_menu_darwin.go b/client/ui/icons_menu_darwin.go index 29fe2d894..6b943d2bf 100644 --- a/client/ui/icons_menu_darwin.go +++ b/client/ui/icons_menu_darwin.go @@ -10,16 +10,15 @@ import _ "embed" // (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. +// iconMenuNetbird on macOS is an 18x18 downscale of the 256x256 brand +// PNG (assets/netbird.png — the same file the legacy Fyne client used +// for its About row). Sized to sit visually alongside the row text — +// the full 256x256 source stretched the row vertically, 22x22 read +// noticeably larger than the surrounding "A" of "About", and 14x14 +// shrank below the cap height. 18 keeps the brand mark legible without +// dominating the row. +//go:embed assets/netbird-menu-about-18.png var iconMenuNetbird []byte //go:embed assets/netbird-menu-dot-connected-22.png diff --git a/client/ui/tray.go b/client/ui/tray.go index 49f16c063..f2d411c39 100644 --- a/client/ui/tray.go +++ b/client/ui/tray.go @@ -403,10 +403,10 @@ func (t *Tray) buildMenu() *application.Menu { aboutLabel := t.loc.T("tray.menu.about") about := menu.AddSubmenu(aboutLabel) - // iconMenuNetbird is empty on macOS — NSMenuItem.setImage stretches - // the row to the leading image's pixel size, and the result looks - // out of place next to the unadorned rows above and below. Skip the - // brand mark there and keep the row text-only. + // iconMenuNetbird is the brand mark painted in the leading-image slot + // of the About row. The icons_menu_.go files own the per-platform + // asset choice — guard with len() so a platform that opts out (sets + // it to an empty []byte) still renders the row text-only. if aboutItem := menu.FindByLabel(aboutLabel); aboutItem != nil && len(iconMenuNetbird) > 0 { aboutItem.SetBitmap(iconMenuNetbird) }