pub struct ScrollableState { /* private fields */ }Expand description
Scroll input for content that supplies its own placement, such as a wheel.
The handler receives logical pixel deltas, positive down or right, and
returns the amount consumed. A partial consumption stops a fling at a
boundary. Modifier::scrollable supplies drag, wheel and fling gestures
without applying a linear layout translation.
Implementations§
Source§impl ScrollableState
impl ScrollableState
Sourcepub fn new(on_delta: impl Fn(f32) -> f32 + 'static) -> Self
pub fn new(on_delta: impl Fn(f32) -> f32 + 'static) -> Self
Creates a scroll state with a delta consumption handler.
Sourcepub fn dispatch_raw_delta(&self, delta: f32) -> f32
pub fn dispatch_raw_delta(&self, delta: f32) -> f32
Applies a scroll delta and returns the amount consumed by the content.
Sourcepub fn is_dragging(&self) -> bool
pub fn is_dragging(&self) -> bool
Whether a pointer is currently dragging this content.
Trait Implementations§
Source§impl Clone for ScrollableState
impl Clone for ScrollableState
Source§impl PartialEq for ScrollableState
impl PartialEq for ScrollableState
impl StructuralPartialEq for ScrollableState
Auto Trait Implementations§
impl !RefUnwindSafe for ScrollableState
impl !Send for ScrollableState
impl !Sync for ScrollableState
impl !UnwindSafe for ScrollableState
impl Freeze for ScrollableState
impl Unpin for ScrollableState
impl UnsafeUnpin for ScrollableState
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
Mutably borrows from an owned value. Read more