pub struct UniformListScrollHandle(pub Rc<RefCell<UniformListScrollState>>);Expand description
A handle for controlling the scroll position of a uniform list. This should be stored in your view and passed to the uniform_list on each frame.
Tuple Fields§
§0: Rc<RefCell<UniformListScrollState>>Implementations§
Source§impl UniformListScrollHandle
impl UniformListScrollHandle
Sourcepub fn scroll_to_item(&self, ix: usize, strategy: ScrollStrategy)
pub fn scroll_to_item(&self, ix: usize, strategy: ScrollStrategy)
Scroll the list so that the given item index is visible.
This uses non-strict scrolling: if the item is already fully visible, no scrolling occurs. If the item is out of view, it scrolls the minimum amount to bring it into view according to the strategy.
Sourcepub fn scroll_to_item_strict(&self, ix: usize, strategy: ScrollStrategy)
pub fn scroll_to_item_strict(&self, ix: usize, strategy: ScrollStrategy)
Scroll the list so that the given item index is at scroll strategy position.
This uses strict scrolling: the item will always be scrolled to match the strategy position, even if it’s already visible. Use this when you need precise positioning.
Sourcepub fn scroll_to_item_with_offset(
&self,
ix: usize,
strategy: ScrollStrategy,
offset: usize,
)
pub fn scroll_to_item_with_offset( &self, ix: usize, strategy: ScrollStrategy, offset: usize, )
Scroll the list to the given item index with an offset in number of items.
This uses non-strict scrolling: if the item is already visible within the offset region, no scrolling occurs.
The offset parameter shrinks the effective viewport by the specified number of items from the corresponding edge, then applies the scroll strategy within that reduced viewport:
ScrollStrategy::Top: Shrinks from top, positions item at the new topScrollStrategy::Center: Shrinks from top, centers item in the reduced viewportScrollStrategy::Bottom: Shrinks from bottom, positions item at the new bottom
Sourcepub fn scroll_to_item_strict_with_offset(
&self,
ix: usize,
strategy: ScrollStrategy,
offset: usize,
)
pub fn scroll_to_item_strict_with_offset( &self, ix: usize, strategy: ScrollStrategy, offset: usize, )
Scroll the list so that the given item index is at the exact scroll strategy position with an offset.
This uses strict scrolling: the item will always be scrolled to match the strategy position, even if it’s already visible.
The offset parameter shrinks the effective viewport by the specified number of items from the corresponding edge, then applies the scroll strategy within that reduced viewport:
ScrollStrategy::Top: Shrinks from top, positions item at the new topScrollStrategy::Center: Shrinks from top, centers item in the reduced viewportScrollStrategy::Bottom: Shrinks from bottom, positions item at the new bottom
Sourcepub fn is_scrollable(&self) -> bool
pub fn is_scrollable(&self) -> bool
Checks if the list can be scrolled vertically.
Sourcepub fn scroll_to_bottom(&self)
pub fn scroll_to_bottom(&self)
Scroll to the bottom of the list.
Trait Implementations§
Source§impl Clone for UniformListScrollHandle
impl Clone for UniformListScrollHandle
Source§fn clone(&self) -> UniformListScrollHandle
fn clone(&self) -> UniformListScrollHandle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for UniformListScrollHandle
impl Debug for UniformListScrollHandle
Source§impl Default for UniformListScrollHandle
impl Default for UniformListScrollHandle
Source§fn default() -> UniformListScrollHandle
fn default() -> UniformListScrollHandle
Auto Trait Implementations§
impl Freeze for UniformListScrollHandle
impl !RefUnwindSafe for UniformListScrollHandle
impl !Send for UniformListScrollHandle
impl !Sync for UniformListScrollHandle
impl Unpin for UniformListScrollHandle
impl !UnwindSafe for UniformListScrollHandle
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().