Skip to content

studio: even the gaps between the window button glyphs - #12782

Merged
shimmyshimmer merged 2 commits into
unslothai:mainfrom
mahiatlinux:fix/studio-caption-glyph-gaps
Oct 6, 2026
Merged

shimmyshimmer merged 2 commits into
unslothai:mainfrom
mahiatlinux:fix/studio-caption-glyph-gaps

Conversation

@mahiatlinux

@mahiatlinux mahiatlinux commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

On main the gap from the maximize glyph to the X is wider than the gap from the minimize line to the maximize glyph, by one device pixel at 150% and above (0.5px at 200%, 0.25px at 400%).

The X's tips cause it. Its round caps sit on 45° diagonals, so the last stretch of each arm carries less ink than the round end of the minimize line or the side of the square, and the X reads about 0.365 stroke widths narrower than the glyphs beside it. CaptionGlyph in studio/frontend/src/components/tauri/window-titlebar.tsx now shifts the minimize and maximize/restore glyphs right by that amount, rounded to whole device pixels so their strokes stay sharp. That is 0 at 100% and 125%, and 1px from 150% to 400%. The X stays centred under its red hover, and overflow="visible" keeps the shifted strokes from being clipped by the 10px glyph box.

Gaps

gaps

Maximize-to-close gap minus minimize-to-maximize gap, in device pixels, from the glyphs' 50%-coverage edges in the running app at an even window width. Restored and maximized give the same result:

scale main this PR
100% 0 0
150% +1 0
200% +1 0
250% +1 0
300% +1 0
400% +1 0

Checks

  • A pixel audit of the Studio frontend with a mocked Windows desktop shell, comparing main and this branch. For every glyph it measured 50%-coverage and area-weighted edges, both gaps, horizontal and vertical centring, and stroke sharpness. It covered 100%, 125%, 150%, 175%, 200%, 250%, 300% and 400%, even and odd window widths, restored and maximized, in light theme, plus dark theme at 100%, 150%, 200% and 400%. The X's position and every glyph's sharpness are unchanged from main.
  • node --test on the 9 titlebar suites: 94 of 94 pass. tsc -p tsconfig.app.json --noEmit is clean, and eslint and biome report nothing new in the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants