Merge: tabs as separate round glass buttons
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
# 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`, `buttonGap` and `rowKey`
|
||||
replace `pillWidth`, the highlight/edge-gap constants and `highlightKey`.
|
||||
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 in
|
||||
`onSecondaryContainer` / 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 merged
|
||||
`SemanticsRole.tab` button with its selected state, named by its label, and
|
||||
"Tab n of m" in the label (Material, off the web, as `NavigationBar`) or the
|
||||
hint (Cupertino, as `CupertinoTabBar`). Material shows the label as a
|
||||
tooltip. `item.key` is 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 (see `perf-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.
|
||||
Reference in New Issue
Block a user