VirtualList
長いリストや高さが可変のコレクションの表示範囲をレイアウトして描画します。
デモを読み込み中…
div()
.h(210.0)
.overflow_hidden()
.virtual_scroll(&list)
.children(list.visible_rows().range.map(|index| text(format!("Row {index}"))))#インポート
quickgui から VirtualList をインポートします。
use quickgui::*;#使い方
div()
.h(210.0)
.overflow_hidden()
.virtual_scroll(&list)
.children(list.visible_rows().range.map(|index| text(format!("Row {index}"))))#API リファレンス
項目を展開すると説明と完全なシグネチャが表示されます。ダッシュは宣言に既定値が記載されていないことを示します。
VirtualList
ソースを見るpub fn new(len: usize, row_height: f32) -> Selfwith_overscanpub fn with_overscan(mut self, rows: usize) -> Self—
lenpub 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) -> boolソースを見るset_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) -> boolソースを見るvisible_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) -> Rectソースを見るscrollbar_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)>ソースを見るvirtual_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) -> Selfソースを見るchildrenpub 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,ソースを見る