pub struct ListViewWidget { /* private fields */ }Expand description
The retained widget for a ListView: the materialized window of children
(children[j] renders item keys[j]), the scroll offset + cached viewport,
and the same fling bookkeeping as crate::ScrollWidget.
Implementations§
Source§impl ListViewWidget
impl ListViewWidget
Sourcepub fn window(&self) -> &[usize]
pub fn window(&self) -> &[usize]
The item indices currently materialized (the visible window ± buffer).
Sourcepub fn max_offset(&self) -> f64
pub fn max_offset(&self) -> f64
The maximum scroll offset (extent − viewport, never negative).
Sourcepub fn is_flinging(&self) -> bool
pub fn is_flinging(&self) -> bool
Whether post-release motion is in flight — the legacy fling, or a
physics-supplied Simulation the generic driver is running (never
both, and never either one under RubberBand’s
legacy-only path).
Sourcepub fn settle_tick(&mut self, dt_ms: f64) -> bool
pub fn settle_tick(&mut self, dt_ms: f64) -> bool
Advance a release-settle by dt_ms, easing
ListViewWidget::overscroll back to 0.0 and returning whether it
is still animating. Pure and deterministic (mirrors
crate::ScrollWidget::settle_tick); the paint pump and the tests
both drive it. Only ever eases overscroll — the windowing
ListViewWidget::offset already sits at the exact edge (0.0 or
max_offset) the moment a drag overscrolls, so it needs no motion of
its own here.
Sourcepub fn tick(&mut self, dt_ms: f64) -> bool
pub fn tick(&mut self, dt_ms: f64) -> bool
Advance an in-flight fling by dt_ms, returning whether it is still
animating. Pure and deterministic — the paint-time pump and the tests
both drive it (mirrors crate::ScrollWidget::tick).
Trait Implementations§
Source§impl Widget for ListViewWidget
impl Widget for ListViewWidget
Source§fn layout(&mut self, ctx: &mut LayoutCtx<'_>, bc: &BoxConstraints) -> Size
fn layout(&mut self, ctx: &mut LayoutCtx<'_>, bc: &BoxConstraints) -> Size
bc and return it. The chosen size must satisfy
bc (callers may additionally clamp via BoxConstraints::constrain).Source§fn paint(&mut self, ctx: &mut PaintCtx<'_>, scene: &mut dyn PaintScene)
fn paint(&mut self, ctx: &mut PaintCtx<'_>, scene: &mut dyn PaintScene)
scene. Read moreSource§fn event(&mut self, ctx: &mut EventCtx<'_>, event: &InputEvent) -> EventResult
fn event(&mut self, ctx: &mut EventCtx<'_>, event: &InputEvent) -> EventResult
ctx and reporting whether it was consumed. Read moreSource§fn semantics(&self, ctx: &mut SemanticsCtx)
fn semantics(&self, ctx: &mut SemanticsCtx)
ctx. Read more