pub struct ScrollHandlingOptions {
pub line_height: f32,
pub smooth: bool,
pub smooth_duration: Duration,
pub overscroll_behavior: OverscrollBehavior,
pub overscroll_style: OverscrollStyle,
pub axes: PanAxes,
pub rubber_band: bool,
pub pan_devices: PointerKindMask,
pub reduced_motion: bool,
pub physics: ScrollPhysicsTokens,
}Expand description
Everything handle_scroll_event needs to know that is not state.
Snapshot, not signals: a scrollable builds one of these in build(), where
the theme and the reduced-motion preference are in scope, and the handler
closure captures it. Both change through a rebuild, which is the level a
density switch and a preference change already mark.
Fields§
§line_height: f32Pixels one ScrollDelta::Lines unit is worth.
smooth: boolWhether a wheel notch tweens to its target instead of jumping. Never consulted on the pan path — a finger is already the animation.
With this on, every ScrollableAxes offset that has a range must
be Signal::new_animated — animate_to panics on a plain signal.
The qualifier is load-bearing, not a caveat: an axis whose maximum is
permanently zero is never written by either path, which is exactly why
ScrollableAxes::vertical and ScrollableAxes::horizontal pin
their unused axis with a plain Signal::new(0.0) and why ListView,
TreeView and GridView each pair ScrollableAxes::vertical with a
smooth_scrolling that defaults to true. The rule is stated once on
ScrollableAxes itself; this is the same rule.
smooth_duration: DurationHow long that tween lasts.
overscroll_behavior: OverscrollBehaviorWhether a boundary scroll chains outward (OverscrollBehavior::Chain)
or is absorbed (OverscrollBehavior::Contain).
overscroll_style: OverscrollStyleWhich overscroll feel this surface asks for when rubber_band is on.
axes: PanAxesWhich axes a finger may pan. An axis outside this set takes no movement from a pan (the wheel path is unaffected — a wheel has always reached every axis the range allows).
rubber_band: boolWhether this surface follows the finger past its own end.
Off by default, and that is the load-bearing default. A band that engages absorbs the movement, so a nested list that rubber-banded at its end would never hand the gesture to the container around it. The band belongs to the outermost surface of a scroll chain; everything inside it clamps and chains, which is also what every desktop toolkit does.
pan_devices: PointerKindMaskWhich pointer kinds may pan this surface. Defaults to
PointerKindMask::DIRECT — a mouse scrolls with its wheel and must
never be treated as a panning pointer.
reduced_motion: boolprefers-reduced-motion, snapshotted at build. Hard-clamps the band.
physics: ScrollPhysicsTokensThe theme’s scroll-physics constants. Only the rubber-band friction factor is read here — the fling’s constants belong to the tree’s driver, which reads them from the same tokens.
Trait Implementations§
Source§impl Clone for ScrollHandlingOptions
impl Clone for ScrollHandlingOptions
impl Copy for ScrollHandlingOptions
Source§impl Debug for ScrollHandlingOptions
impl Debug for ScrollHandlingOptions
Auto Trait Implementations§
impl Freeze for ScrollHandlingOptions
impl RefUnwindSafe for ScrollHandlingOptions
impl Send for ScrollHandlingOptions
impl Sync for ScrollHandlingOptions
impl Unpin for ScrollHandlingOptions
impl UnsafeUnpin for ScrollHandlingOptions
impl UnwindSafe for ScrollHandlingOptions
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more