S016: chrome and menus redesign: pill tabs on springs, address pill, toolbar badges, page card, floating flyouts

Tabs slide to their slots with a sliding selection pill and drag under the
pointer; the address field is a pill with a site chip, host emphasis and a
star that fills; flyouts and menus share one floating surface that springs
open and fades closed. Web page corners are masked over the GL blit.
tests/smoke/chrome.txt shoots the chrome and every flyout dark and light.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
astar76 2026-11-11 20:11:33 -06:00
commit 72d06510b2

View file

@ -220,6 +220,26 @@ while something plays), `shadow(painter, rect, radius, dark)` (one soft shadow f
a font family); shadows are tessellator-blurred rectangles only (not arbitrary shapes); `Ui::id`/`Id::new` are
deprecated in 0.37 but still used across the code.
**Chrome** (S016, `src/ui/chrome.rs`). Everything behind the chrome and around the page is `chrome::chrome_fill`
(`surface_container`); the page is a card with margin `GAP_S` (sides and bottom) and radius `L`. Web pages are
blitted as rectangles, so `ui::card_corners` paints a ring in the chrome colour over the corners (works over the GL
blit). Heights: tab strip 44 (tab pills 34, gap 4, width 76..240, pinned 44, +24 with an audio button), toolbar 52
(address pill 40), bookmarks bar 36 (chips 28), title bar 36, app bar 44; buttons inside tabs and the address field
are 24. Tabs slide to their slots with `DEFAULT` springs, the selection pill (secondary_container) slides between
them, a dragged tab stays under the pointer (`theme::spring_jump`) and the others make room (`drag_layout`); a
window resize jumps instead of sliding. Toolbar order: back, forward, reload, home, incognito | address | passwords,
history, bookmarks, downloads, qr, apps, devtools, pip, screenshot, adblock, media, vpn, profile, menu (each shown
per the toolbar setting). Status on buttons: badges (blocked count, running downloads), a progress ring round
downloads, a coloured dot on the VPN, a slash through the shield when off. All icons are Material Symbols (D-009).
**Floating surfaces** (`src/ui/menus.rs`). `menus::floating(ctx, id, pos, pivot, open, |ui| ..)` draws a
`menus::surface` (surface_container_high, radius `L`, popup shadow) that grows from its pivot corner (scale 0.9 to
1, `DEFAULT`) and fades in (`EFFECT`); with `open` false it shrinks and fades without input, then returns None.
Flyouts keep the last one drawn so it animates out; switching flyouts closes one while the other opens. Rows:
`menu_item(ui, icon, label, trailing, selected)` (34 high, icon column, label cut with an ellipsis, shortcut or
detail on the right), `divider`, `empty`, `one_line` (text cut to a width). egui popups (`Popup::menu`, submenus)
use the same `surface` frame. Areas need `default_size` set or egui caps them at 600×400.
## Feature checklist
See `docs/FEATURES.md`; every row names the file that implements it and its review state.