pub struct AppBarScrollState { /* private fields */ }Expand description
Retained app bar presentation state. Use a distinct entity per app bar.
Implementations§
Source§impl AppBarScrollState
impl AppBarScrollState
Sourcepub fn set_content_offset(&mut self, offset: Pixels, cx: &mut Context<'_, Self>)
pub fn set_content_offset(&mut self, offset: Pixels, cx: &mut Context<'_, Self>)
Supplies a nonnegative distance from the top for an externally scrolled view. A linked GPUI ScrollHandle takes precedence when present.
Sourcepub fn set_collapsed_fraction(
&mut self,
fraction: f32,
cx: &mut Context<'_, Self>,
)
pub fn set_collapsed_fraction( &mut self, fraction: f32, cx: &mut Context<'_, Self>, )
Sets the presentation fraction immediately, provided the bar can collapse.
Sourcepub fn settle(&mut self, velocity: f32, cx: &mut Context<'_, Self>)
pub fn settle(&mut self, velocity: f32, cx: &mut Context<'_, Self>)
Settles at an endpoint of the current range. Velocity is in logical pixels per second, positive away from the top. A zero velocity uses the nearest endpoint.
Sourcepub fn content_offset(&self) -> Pixels
pub fn content_offset(&self) -> Pixels
Returns the last observed content scroll distance from the top.
Sourcepub fn height_offset(&self) -> Pixels
pub fn height_offset(&self) -> Pixels
Current displayed height offset. Expanded is zero, and collapse is negative.
Sourcepub fn height_offset_limit(&self) -> Pixels
pub fn height_offset_limit(&self) -> Pixels
Returns the maximum negative height offset (zero when the bar cannot collapse).
Sourcepub fn collapsed_fraction(&self) -> f32
pub fn collapsed_fraction(&self) -> f32
Returns the current collapse progress in 0.0..=1.0.
Sourcepub fn overlapped_fraction(&self) -> f32
pub fn overlapped_fraction(&self) -> f32
Returns the fraction of scrolled-under overlap in 0.0..=1.0, used for scrolled container color.
Trait Implementations§
Auto Trait Implementations§
impl Forget for AppBarScrollState
impl Freeze for AppBarScrollState
impl Move for AppBarScrollState
impl RefUnwindSafe for AppBarScrollState
impl Send for AppBarScrollState
impl Sync for AppBarScrollState
impl Unpin for AppBarScrollState
impl UnsafeUnpin for AppBarScrollState
impl UnwindSafe for AppBarScrollState
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
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> ⓘ
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> ⓘ
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>
ReadEndian::read_from_little_endian().