Skip to content

fix(menu-bar): center icon and match neighbor spacing - #5

Merged
duongdev merged 1 commit into
mainfrom
fix/menu-bar-spacing
Nov 14, 2026
Merged

duongdev merged 1 commit into
mainfrom
fix/menu-bar-spacing

Conversation

@duongdev

Copy link
Copy Markdown
Owner

Summary

The menu bar icon sat too close to the icon on its right.

Causes:

  • The glyph filled its 16 pt image from edge to edge, so the handle touched the right edge of the image.
  • With the time left shown, AppKit adds 2 pt more padding at each end of a titled status button. This moved the icon away from the left.

Fix:

  • The glyph is now drawn on an 18 × 16 pt canvas. It is placed so the cup and handle are centered, because the thin saucer tip does not count visually.
  • The button always uses image-only layout. The time left is drawn into the template image, not set as the title.
  • The VoiceOver label now includes the time left.

Test

Measured from screenshots of the real menu bar. The margin is the ink distance to the status item's frame. Other items have a median of 3.5 pt.

State Before (left / right) After (left / right)
Off 3.5 / 2.0 4.0 / 4.0
On 3.5 / 2.0 4.0 / 4.0
On, time left shown 6.0 / – 4.0 / –

With the time left shown, the right side ends in text, so only the left margin is compared.

  • I also checked the time left by eye: the text is vertically centered and tinted like the icon, and the selection highlight has even padding.
  • swift test --package-path WakefulCore passes, and the Release build succeeds.

@duongdev
duongdev merged commit 6e89a1b into main Nov 14, 2026
3 checks passed
@duongdev
duongdev deleted the fix/menu-bar-spacing branch December 1, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant