Skip to content

On macOS, the window buttons sit centred in the title bar and the File back button no longer crowds them - #255

Merged
echelon merged 1 commit into
storytold:mainfrom
vangel76:fix/225-222-macos-titlebar
Oct 10, 2026
Merged

echelon merged 1 commit into
storytold:mainfrom
vangel76:fix/225-222-macos-titlebar

Conversation

@vangel76

Copy link
Copy Markdown
Contributor

Cause

On macOS the window has no system title bar (with_fullsize_content_view, with_titlebar_shown(false)), and AppKit draws the traffic lights itself, centred in its standard 28 pt title-bar band at the top of the window. WordCraft's own title bar was 38 pt tall, so the lights sat about 5 pt above its centre line (#225).

The Backstage (File) covers the whole window, title bar included. Its back button was a 40 pt row starting 12 pt from the top, so the chevron sat right under the red button, almost touching it (#222).

Neither winit 0.30.13 nor egui/eframe 0.36 offers a way to move the traffic lights, and doing it directly means AppKit calls (unsafe), which the workspace forbids. So the title bar now fits the lights, rather than the other way round.

Change

macOS only (integrated_titlebar, which main.rs sets on macOS only). Linux and Windows layouts don't change.

  • Title bar: 28 pt tall, so the lights are vertically centred in it. The search box and account button drop from 26 pt to 22 pt so they keep a margin above and below. Content starts at MAC_CONTENT_LEFT = the end of the three lights (12 pt buttons, 20 pt pitch, first one at about 10 pt) plus the 8 pt gap the lights keep from the top. That's 70 pt, down from 78.
  • Backstage: the top 28 pt of the blue column is now a title bar. The back chevron sits beside the lights, centred with them, and starts at the same inset as the main title bar's AutoSave label. The rest of that band drags the window (before, the window couldn't be moved while File was open). The page list starts below it.
  • The geometry lives in one place (chrome.rs), with a small test that checks the lights are centred and the gap after them matches.

Testing

  • Not run on a Mac. I have no macOS machine. The geometry comes from the screenshots in both issues, where the lights are 12 pt across with a 20 pt pitch and centred about 14 pt from the top. Please check it on a Mac before merging.
  • ui_shot (which turns on the integrated title bar) with the traffic lights drawn on at their measured position: they're centred in the title bar, and the Backstage chevron sits beside them with an 8 pt gap.
  • cargo test -p wordcraft-ui-egui, cargo clippy -p wordcraft-ui-egui --all-targets -- -D warnings, cargo fmt --all, cargo xtask layers, cargo xtask assets, cargo xtask wasm.

Fixes #225
Fixes #222

🤖 Generated with Claude Code

…ck button (storytold#225, storytold#222)

AppKit keeps the traffic lights in its standard 28 pt title-bar band at the
top of the window, but the integrated title bar was 38 pt tall, so the lights
sat above its centre line. Moving them would need AppKit calls (unsafe), so
on macOS the title bar is now that band's height, with the search box and
account button shrunk to fit. Content starts after the lights plus the same
gap they keep from the top edge.

The Backstage covers the title bar, and its back button sat right under the
traffic lights. On macOS its top band is now a title bar: the back button sits
beside the lights, centred with them at the same inset as the main title
bar's controls, and the rest of the band drags the window. Linux and Windows
are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@echelon
echelon merged commit ca83ba7 into storytold:main Oct 10, 2026
@echelon

echelon commented Oct 10, 2026

Copy link
Copy Markdown
Member

Merged — thank you for tidying the macOS title bar and the File back button! It's on main now. If you're not on our Discord yet, come say hi: https://discord.gg/artcraft

echelon pushed a commit to storytold/cadcraft that referenced this pull request Oct 10, 2026
…#202)

AppKit draws the traffic lights centred in its standard 28 pt title-bar
band, and the integrated title row is that band, but the title text sat
1 pt below the centre line. It is now centred on the lights. Neither
winit nor eframe can move the lights without AppKit calls (unsafe), so
the row fits them instead, as in WordCraft (storytold/wordcraft#255).

The geometry lives in chrome.rs. A long drawing name in a narrow window
no longer slides under the lights: the title starts after them, with the
same gap the lights keep from the top of the window.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
echelon pushed a commit to storytold/pdfcraft that referenced this pull request Oct 11, 2026
… in (#789) (#1055)

AppKit centres the window buttons in its standard 28 pt title-bar band and
nothing in winit/eframe moves them (AppKit calls would need unsafe, which the
workspace forbids). The integrated title bar was 38 pt with 30 pt tabs, so the
lights sat 5 pt above its centre. On macOS the strip is now 28 pt, tabs 26 pt,
icon buttons 24 pt, and content starts after the lights plus the gap they keep
from the top (MAC_CONTENT_LEFT), as storytold/wordcraft#255 did for WordCraft.
Other platforms are unchanged. Unit test for the constants, macOS kittest for
the strip's contents staying inside the band.

Co-authored-by: Tristan von Kries <tristan@MacBook-Pro-von-Tristan.local>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
tarpescu added a commit to tarpescu/wordcraft that referenced this pull request Oct 13, 2026
The un-bundled dev binary is 'wordcraft', which macOS shows as the app-menu title; the packaged app sets CFBundleName = WordCraft and reads right. Set NSProcessInfo.processName at start-up so the dev build does too (storytold#255).
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.

Window controls misaligned on macOS Button to close Files overlay misaligned on macOS

2 participants