本文へスキップ

VirtualList

長いリストや高さが可変のコレクションの表示範囲をレイアウトして描画します。

デモを読み込み中…

#インポート

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 リファレンス

項目を展開すると説明と完全なシグネチャが表示されます。ダッシュは宣言に既定値が記載されていないことを示します。

pub fn new(len: usize, row_height: f32) -> Self
with_overscanpub fn with_overscan(mut self, rows: usize) -> Self—

Configures with overscan for this part.

pub fn with_overscan(mut self, rows: usize) -> Self
ソースを見る
lenpub fn len(&self) -> usize—

Configures len for this part.

pub fn len(&self) -> usize
ソースを見る
is_emptypub fn is_empty(&self) -> bool—

Configures is empty for this part.

pub fn is_empty(&self) -> bool
ソースを見る
row_heightpub fn row_height(&self) -> f32—

Configures row height for this part.

pub fn row_height(&self) -> f32
ソースを見る
content_heightpub fn content_height(&self) -> f32—

Configures content height for this part.

pub fn content_height(&self) -> f32
ソースを見る
viewport_heightpub fn viewport_height(&self) -> f32—

Configures viewport height for this part.

pub 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—

Configures set len for this part.

pub fn set_len(&mut self, len: usize) -> bool
ソースを見る
scroll_offsetpub fn scroll_offset(&self) -> f32—

Configures scroll offset for this part.

pub fn scroll_offset(&self) -> f32
ソースを見る
max_scroll_offsetpub fn max_scroll_offset(&self) -> f32—

Configures max scroll offset for this part.

pub fn max_scroll_offset(&self) -> f32
ソースを見る
scroll_bypub fn scroll_by(&mut self, delta: f32) -> bool—

Configures scroll by for this part.

pub fn scroll_by(&mut self, delta: f32) -> bool
ソースを見る
scroll_topub fn scroll_to(&mut self, offset: f32) -> bool—

Configures scroll to for this part.

pub 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—

Configures visible rows for this part.

pub 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,
ソースを見る