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.
Trait Implementations§
Source§impl Clone for HeaderState
impl Clone for HeaderState
Source§fn clone(&self) -> HeaderState
fn clone(&self) -> HeaderState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for HeaderState
Source§impl Debug for HeaderState
impl Debug for HeaderState
Source§impl PartialEq for HeaderState
impl PartialEq for HeaderState
impl StructuralPartialEq for HeaderState
Auto Trait Implementations§
impl Freeze for HeaderState
impl RefUnwindSafe for HeaderState
impl Send for HeaderState
impl Sync for HeaderState
impl Unpin for HeaderState
impl UnsafeUnpin for HeaderState
impl UnwindSafe for HeaderState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.