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 moreSource§fn visit_children(&self, visitor: &mut dyn FnMut(&ChildPod))
fn visit_children(&self, visitor: &mut dyn FnMut(&ChildPod))
Auto Trait Implementations§
impl !RefUnwindSafe for ListViewWidget
impl !Send for ListViewWidget
impl !Sync for ListViewWidget
impl !UnwindSafe for ListViewWidget
impl Freeze for ListViewWidget
impl Unpin for ListViewWidget
impl UnsafeUnpin for ListViewWidget
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.