VirtualList
Lays out and paints the visible part of a long or variable-height collection.
Loading interactive demo…
div()
.h(210.0)
.overflow_hidden()
.virtual_scroll(&list)
.children(list.visible_rows().range.map(|index| text(format!("Row {index}"))))#Import
Import VirtualList from quickgui.
use quickgui::*;#Usage
div()
.h(210.0)
.overflow_hidden()
.virtual_scroll(&list)
.children(list.visible_rows().range.map(|index| text(format!("Row {index}"))))#API reference
Expand an entry for its description and complete signature. A dash means no declaration default is documented.
VirtualList
View sourcepub fn new(len: usize, row_height: f32) -> Selfwith_overscanpub fn with_overscan(mut self, rows: usize) -> Self—
Configures with overscan for this part.
pub fn with_overscan(mut self, rows: usize) -> SelfView sourcelenpub fn len(&self) -> usize—
is_emptypub fn is_empty(&self) -> bool—
row_heightpub fn row_height(&self) -> f32—
content_heightpub fn content_height(&self) -> f32—
viewport_heightpub fn viewport_height(&self) -> f32—
set_viewport_heightpub fn set_viewport_height(&mut self, height: f32) -> bool—
Configures set viewport height for this part.
pub fn set_viewport_height(&mut self, height: f32) -> boolView sourceset_lenpub fn set_len(&mut self, len: usize) -> bool—
scroll_offsetpub fn scroll_offset(&self) -> f32—
max_scroll_offsetpub fn max_scroll_offset(&self) -> f32—
scroll_bypub fn scroll_by(&mut self, delta: f32) -> bool—
scroll_topub fn scroll_to(&mut self, offset: f32) -> bool—
scroll_to_revealpub fn scroll_to_reveal(&mut self, index: usize) -> bool—
Scroll the smallest distance needed to expose one complete row.
pub fn scroll_to_reveal(&mut self, index: usize) -> boolView sourcevisible_rowspub fn visible_rows(&self) -> VisibleRows—
row_rectpub fn row_rect(&self, index: usize, viewport_x: f32, viewport_y: f32, width: f32) -> Rect—
The logical rectangle for a row inside a viewport whose top is `viewport_y`.
pub fn row_rect(&self, index: usize, viewport_x: f32, viewport_y: f32, width: f32) -> RectView sourcescrollbar_thumbpub fn scrollbar_thumb(&self, minimum_height: f32) -> Option<(f32, f32)>—
Returns `(thumb_offset, thumb_height)` in viewport-local coordinates.
pub fn scrollbar_thumb(&self, minimum_height: f32) -> Option<(f32, f32)>View sourcevirtual_scrollpub fn virtual_scroll(mut self, list: &VirtualList) -> Self—
Bind this clipped viewport to a fixed-height [`VirtualList`]. The mounted rows remain application-controlled, while QuickGUI owns the native-style retained scrollbar, wheel routing, pointer capture, hover expansion, and one-shot autohide. Offset changes rebuild the virtualized view only when the offset actually moves; hover and visibility changes stay paint-only.
pub fn virtual_scroll(mut self, list: &VirtualList) -> SelfView sourcechildrenpub fn children<I, E>(mut self, children: I) -> Self where I: IntoIterator<Item = E>, E: IntoElement,—
Configures children for this part.
pub fn children<I, E>(mut self, children: I) -> Self where I: IntoIterator<Item = E>, E: IntoElement,View source