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>
impl<Msg: Clone + 'static> CollapsingHeader<Msg>
Sourcepub fn new<W: Widget<Msg> + 'static>(
body: impl Widget<Msg> + 'static,
build: impl Fn(HeaderState) -> W + 'static,
) -> Self
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.
Sourcepub fn expanded_height(self, height: f32) -> Self
pub fn expanded_height(self, height: f32) -> Self
The height when nothing has scrolled, overriding the body’s top padding.
Sourcepub fn collapsed_height(self, height: f32) -> Self
pub fn collapsed_height(self, height: f32) -> Self
The height it stops shrinking at. Ignored by CollapsingHeader::floating.
Sourcepub fn floating(self) -> Self
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.
Sourcepub fn build(self) -> ScrollOverlay<Msg>
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>
impl<Msg> Unpin for CollapsingHeader<Msg>
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> 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
Mutably borrows from an owned value. Read more