pub struct VirtualGrid { /* private fields */ }Expand description
Virtualized grid state
Implementations§
Source§impl VirtualGrid
impl VirtualGrid
pub fn new(config: VirtualGridConfig) -> Self
Sourcepub fn set_item_count(&mut self, count: usize)
pub fn set_item_count(&mut self, count: usize)
Set total item count
Sourcepub fn item_count(&self) -> usize
pub fn item_count(&self) -> usize
Get total item count
Sourcepub fn set_viewport_height(&mut self, height: f32)
pub fn set_viewport_height(&mut self, height: f32)
Set viewport height
Sourcepub fn viewport_height(&self) -> f32
pub fn viewport_height(&self) -> f32
Get viewport height
Sourcepub fn set_scroll_position(&mut self, position: f32)
pub fn set_scroll_position(&mut self, position: f32)
Set scroll position
Sourcepub fn scroll_position(&self) -> f32
pub fn scroll_position(&self) -> f32
Get current scroll position
Sourcepub fn max_scroll(&self) -> f32
pub fn max_scroll(&self) -> f32
Get maximum scroll position
Sourcepub fn scroll_to_item(&mut self, index: usize, align: ScrollAlign)
pub fn scroll_to_item(&mut self, index: usize, align: ScrollAlign)
Scroll to specific item
Sourcepub fn row_height(&self) -> f32
pub fn row_height(&self) -> f32
Get row height (cell height + gap)
Sourcepub fn row_position(&self, row: usize) -> f32
pub fn row_position(&self, row: usize) -> f32
Get row position
Sourcepub fn content_height(&self) -> f32
pub fn content_height(&self) -> f32
Get content height
Sourcepub fn get_cell_layout(&self, index: usize) -> CellLayout
pub fn get_cell_layout(&self, index: usize) -> CellLayout
Get cell layout by index
Sourcepub fn get_cell_layout_by_position(&self, row: usize, col: usize) -> CellLayout
pub fn get_cell_layout_by_position(&self, row: usize, col: usize) -> CellLayout
Get cell layout by row/column
Sourcepub fn cell_to_index(&self, cell: &GridCell) -> usize
pub fn cell_to_index(&self, cell: &GridCell) -> usize
Convert grid cell to item index
Sourcepub fn index_to_cell(&self, index: usize) -> GridCell
pub fn index_to_cell(&self, index: usize) -> GridCell
Convert item index to grid cell
Sourcepub fn visible_range(&self) -> Option<&VisibleGridRange>
pub fn visible_range(&self) -> Option<&VisibleGridRange>
Get visible range
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VirtualGrid
impl RefUnwindSafe for VirtualGrid
impl Send for VirtualGrid
impl Sync for VirtualGrid
impl Unpin for VirtualGrid
impl UnwindSafe for VirtualGrid
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 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>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().