pub struct ScrollHandle(/* private fields */);Expand description
A handle to the scrollable aspects of an element. Used for accessing scroll state, like the current scroll offset, and for mutating the scroll state, like scrolling to a specific child.
Implementations§
Source§impl ScrollHandle
impl ScrollHandle
Sourcepub fn max_offset(&self) -> Size<Pixels>
pub fn max_offset(&self) -> Size<Pixels>
Get the maximum scroll offset.
Sourcepub fn bottom_item(&self) -> usize
pub fn bottom_item(&self) -> usize
Get the bottom child that’s scrolled into view.
Sourcepub fn bounds_for_item(&self, ix: usize) -> Option<Bounds<Pixels>>
pub fn bounds_for_item(&self, ix: usize) -> Option<Bounds<Pixels>>
Get the bounds for a specific child.
Sourcepub fn scroll_to_item(&self, ix: usize)
pub fn scroll_to_item(&self, ix: usize)
Update [ScrollHandleState]’s active item for scrolling to in prepaint
Sourcepub fn scroll_to_top_of_item(&self, ix: usize)
pub fn scroll_to_top_of_item(&self, ix: usize)
Update [ScrollHandleState]’s active item for scrolling to in prepaint This scrolls the minimal amount to ensure that the child is the first visible element
Sourcepub fn scroll_to_bottom(&self)
pub fn scroll_to_bottom(&self)
Scrolls to the bottom.
Sourcepub fn set_offset(&self, position: Point<Pixels>)
pub fn set_offset(&self, position: Point<Pixels>)
Set the offset explicitly. The offset is the distance from the top left of the parent container to the top left of the first child. As you scroll further down the offset becomes more negative.
Sourcepub fn logical_scroll_top(&self) -> (usize, Pixels)
pub fn logical_scroll_top(&self) -> (usize, Pixels)
Get the logical scroll top, based on a child index and a pixel offset.
Sourcepub fn logical_scroll_bottom(&self) -> (usize, Pixels)
pub fn logical_scroll_bottom(&self) -> (usize, Pixels)
Get the logical scroll bottom, based on a child index and a pixel offset.
Sourcepub fn children_count(&self) -> usize
pub fn children_count(&self) -> usize
Get the count of children for scrollable item.
Trait Implementations§
Source§impl Clone for ScrollHandle
impl Clone for ScrollHandle
Source§fn clone(&self) -> ScrollHandle
fn clone(&self) -> ScrollHandle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ScrollHandle
impl Debug for ScrollHandle
Auto Trait Implementations§
impl Freeze for ScrollHandle
impl !RefUnwindSafe for ScrollHandle
impl !Send for ScrollHandle
impl !Sync for ScrollHandle
impl Unpin for ScrollHandle
impl !UnwindSafe for ScrollHandle
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
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.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
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().