377ff04aaf
Replace the single glass pill (host NavigationBar/CupertinoTabBar with one gliding highlight) with a row of separate circular GlassPill buttons, 52/50 px with 12/10 px gaps, at the same bottom-right place. The selected button fills with the host selection tint and cross-fades; each button pops in on its own, staggered, only when the bar appears or its tabs change; presses sink like the top bar's. Tab semantics, keys, tooltips and badges are kept; the row shares one BackdropGroup for its blurs.
2.4 KiB
2.4 KiB
Floating tab bars: one round glass button per tab
FloatingDestinationBar (the shell's destinations and every page's tabs) was
one glass pill holding the host NavigationBar / CupertinoTabBar, with a
single highlight circle gliding between tabs. Each tab is now its own round
GlassPill button (FloatingTabButton), in a row at the same place
(bottom right, kFloatingBarMargin, safe area; page tabs kStackedBarGap
above the shell row).
- Size: 52 px Material, 50 px Cupertino (the old circle was 44/42); icons
28/30 as before; gaps 12/10. The bar's height is the button size.
FloatingDestinationBar.rowWidth,buttonSize,buttonGapandrowKeyreplacepillWidth, the highlight/edge-gap constants andhighlightKey. A row narrower than its natural width shrinks its gaps, then scales down. - Selection: the selected button fills with
secondaryContainer(Material) or the active colour at 18% (Cupertino) and draws its icon inonSecondaryContainer/ the active colour; the fill and icon colour cross-fade (Motion.tabSelectDuration), and the new icon bounces as before. The gliding highlight was dropped: between separate buttons it would cross the gaps over the content. - Entrance: each whole button pops in (0.6 -> 1, ease-out-back, 70 ms
stagger), its glass fading through
GlassReveal; only when the bar first builds or its tab set changes. - Press:
SegmentedPress, as in the top bar; Material keeps its circular ink. - Semantics: the row is a
SemanticsRole.tabBar; each button a mergedSemanticsRole.tabbutton with its selected state, named by its label, and "Tab n of m" in the label (Material, off the web, asNavigationBar) or the hint (Cupertino, asCupertinoTabBar). Material shows the label as a tooltip.item.keyis on each button. - Badges: the icon is painted above the glass, outside its circular clip, so a badge on the icon's corner is not cut off.
- Blur: the buttons of a bar share one
BackdropGroup, so on Impeller they read the content behind them once (seeperf-glass-chrome.md; CanvasKit ignores backdrop keys and blurs each button).
Evidence: /tmp/tab-buttons/ (start-, flow- at 560x900 and 880x1000,
Material and Cupertino; light-* shots). The kit's film step after open
recorded a cropped frame (560x347, 756x469); re-applying the viewport size
before filming (as the films here did) gives full-size frames.