pub struct ListClipper { /* private fields */ }
Expand description
Used to render only the visible items when displaying a long list of items in a scrollable area.
For example, you can have a huge list of checkboxes.
Without the clipper you have to call ui.checkbox(...)
for every one, even if 99% of of them are not visible in
the current frame. Using the ListClipper
, you can only
call ui.checkbox(...)
for the currently visible items.
Note the efficiency of list clipper relies on the height of each item being cheaply calculated. The current rust bindings only works with a fixed height for all items.
Implementations§
Source§impl ListClipper
impl ListClipper
Sourcepub const fn new(items_count: i32) -> ListClipper
pub const fn new(items_count: i32) -> ListClipper
Begins configuring a list clipper.
Sourcepub const fn items_height(self, items_height: f32) -> ListClipper
pub const fn items_height(self, items_height: f32) -> ListClipper
Manually set item height. If not set, the height of the first item is used for all subsequent rows.
pub fn begin(self, ui: &Ui) -> ListClipperToken<'_>
Auto Trait Implementations§
impl Freeze for ListClipper
impl RefUnwindSafe for ListClipper
impl Send for ListClipper
impl Sync for ListClipper
impl Unpin for ListClipper
impl UnwindSafe for ListClipper
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
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 more