pub struct ToolbarScrollState { /* private fields */ }Expand description
Retained toolbar scroll state. Use one entity per toolbar.
Implementations§
Source§impl ToolbarScrollState
impl ToolbarScrollState
Sourcepub fn new() -> ToolbarScrollState
pub fn new() -> ToolbarScrollState
Creates a toolbar scroll state starting expanded at offset 0.
Sourcepub fn set_content_offset(
&mut self,
offset: Pixels,
cx: &mut Context<'_, ToolbarScrollState>,
)
pub fn set_content_offset( &mut self, offset: Pixels, cx: &mut Context<'_, ToolbarScrollState>, )
Supplies nonnegative logical pixels from the top of externally scrolled content.
Sourcepub fn set_collapsed_fraction(
&mut self,
fraction: f32,
cx: &mut Context<'_, ToolbarScrollState>,
)
pub fn set_collapsed_fraction( &mut self, fraction: f32, cx: &mut Context<'_, ToolbarScrollState>, )
Sets the target collapsed fraction directly (0.0 expanded to 1.0 collapsed).
Sourcepub fn settle(
&mut self,
velocity: f32,
cx: &mut Context<'_, ToolbarScrollState>,
)
pub fn settle( &mut self, velocity: f32, cx: &mut Context<'_, ToolbarScrollState>, )
Releases an application-owned gesture. Positive logical pixels per second exit the strip.
Sourcepub fn content_offset(&self) -> Pixels
pub fn content_offset(&self) -> Pixels
Returns the most recently observed content scroll offset in logical pixels.
Sourcepub fn offset(&self) -> Pixels
pub fn offset(&self) -> Pixels
The displayed nonnegative travel toward the configured logical edge.
Sourcepub fn offset_limit(&self) -> Pixels
pub fn offset_limit(&self) -> Pixels
Returns the maximum slide travel distance in logical pixels for the current toolbar footprint.
Sourcepub fn collapsed_fraction(&self) -> f32
pub fn collapsed_fraction(&self) -> f32
Returns the current displayed collapsed fraction in 0.0..=1.0.
Trait Implementations§
Source§impl Default for ToolbarScrollState
impl Default for ToolbarScrollState
Source§fn default() -> ToolbarScrollState
fn default() -> ToolbarScrollState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Forget for ToolbarScrollState
impl Freeze for ToolbarScrollState
impl Move for ToolbarScrollState
impl RefUnwindSafe for ToolbarScrollState
impl Send for ToolbarScrollState
impl Sync for ToolbarScrollState
impl Unpin for ToolbarScrollState
impl UnsafeUnpin for ToolbarScrollState
impl UnwindSafe for ToolbarScrollState
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().