pub struct HeaderState {
pub fraction: f32,
pub height: f32,
pub width: f32,
pub expanded_height: f32,
pub collapsed_height: f32,
}Expand description
How far collapsed the header is, handed to its builder every frame it moves.
Fields§
§fraction: f320.0 fully expanded, 1.0 fully collapsed. What a header should be written
against: a size, an opacity or a corner interpolated on this reads the same
whatever the two heights happen to be, and survives somebody changing them.
height: f32The height the header is being drawn at, in logical pixels.
width: f32How wide it is — the page, not the title.
Handed over because a header has to state it: a box left to size itself is as wide as its own content, which is a band with the list showing either side of it. The first golden of this widget was exactly that, and no test measuring heights could have seen it.
expanded_height: f32The height it has when nothing has scrolled.
collapsed_height: f32The height it stops at, or 0 for a header that goes entirely.