Skip to main content

CollapsingHeader

Struct CollapsingHeader 

Source
pub struct CollapsingHeader<Msg = Callback> { /* private fields */ }
Expand description

A header over a scroll region, interpolated between two heights by the region’s offset.

Implementations§

Source§

impl<Msg: Clone + 'static> CollapsingHeader<Msg>

Source

pub fn new<W: Widget<Msg> + 'static>( body: impl Widget<Msg> + 'static, build: impl Fn(HeaderState) -> W + 'static, ) -> Self

A header built from build, over the scroll region body.

The expanded height is the body’s own top padding; see the module documentation for why that is the number rather than a second one here.

Source

pub fn expanded_height(self, height: f32) -> Self

The height when nothing has scrolled, overriding the body’s top padding.

Source

pub fn collapsed_height(self, height: f32) -> Self

The height it stops shrinking at. Ignored by CollapsingHeader::floating.

Source

pub fn floating(self) -> Self

Goes entirely instead of stopping at a toolbar, leaving the whole window to the content — a reading view, where the chrome is worth its room only while somebody is choosing what to read.

Source

pub fn build(self) -> ScrollOverlay<Msg>

The widget: the body with the header drawn over it.

Auto Trait Implementations§

§

impl<Msg = Callback> !RefUnwindSafe for CollapsingHeader<Msg>

§

impl<Msg = Callback> !Send for CollapsingHeader<Msg>

§

impl<Msg = Callback> !Sync for CollapsingHeader<Msg>

§

impl<Msg = Callback> !UnwindSafe for CollapsingHeader<Msg>

§

impl<Msg> Freeze for CollapsingHeader<Msg>
where Box<dyn Widget<Msg>>: Freeze, Box<dyn Fn(HeaderState) -> Box<dyn Widget<Msg>>>: Freeze,

§

impl<Msg> Unpin for CollapsingHeader<Msg>
where Box<dyn Widget<Msg>>: Unpin, Box<dyn Fn(HeaderState) -> Box<dyn Widget<Msg>>>: Unpin,

§

impl<Msg> UnsafeUnpin for CollapsingHeader<Msg>
where Box<dyn Widget<Msg>>: UnsafeUnpin, Box<dyn Fn(HeaderState) -> Box<dyn Widget<Msg>>>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<Msg> IntoMsg<Msg> for Msg

Source§

fn defer(work: impl Fn() -> Msg + 'static) -> Msg

The message that stands for work’s result.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.