pub struct OverscrollIndicatorNotification {
pub leading: bool,
pub paint_offset: Cell<f64>,
pub accepted: Cell<bool>,
/* private fields */
}Expand description
A notification that either a GlowingOverscrollIndicator or a
StretchingOverscrollIndicator will start showing an overscroll indication.
To prevent the indicator from showing the indication, call
disallow_indicator on the notification.
A listener writes paint_offset and
accepted through a shared reference, as the notification bubbles as
&dyn Notification; the indicator reads them back once the dispatch returns.
See also:
GlowingOverscrollIndicator, which generates this type of notification by painting an indicator over the child content.StretchingOverscrollIndicator, which generates this type of notification by applying a stretch transformation to the child content.
Fields§
§leading: boolWhether the indication will be shown on the leading edge of the scroll view.
paint_offset: Cell<f64>Controls at which offset a GlowingOverscrollIndicator draws.
A positive offset will move the glow away from its edge,
i.e. for a vertical, leading indicator, a
paint_offset of 100.0 will draw the indicator 100.0 pixels
from the top of the edge. For a vertical indicator with leading
set to false, a paint_offset of 100.0 will draw the indicator
100.0 pixels from the bottom instead.
A negative paint_offset is generally not useful, since the
glow will be clipped.
This has no effect on a StretchingOverscrollIndicator.
accepted: Cell<bool>Whether the current overscroll event will allow for the indicator to be shown.
Calling disallow_indicator sets this to false,
preventing the over scroll indicator from showing.
Defaults to true.
Implementations§
Source§impl OverscrollIndicatorNotification
impl OverscrollIndicatorNotification
Sourcepub fn new(leading: bool) -> OverscrollIndicatorNotification
pub fn new(leading: bool) -> OverscrollIndicatorNotification
Creates a notification that an GlowingOverscrollIndicator or a
StretchingOverscrollIndicator will start showing an overscroll indication.
Sourcepub fn disallow_indicator(&self)
pub fn disallow_indicator(&self)
Call this method if the overscroll indicator should be prevented.
Trait Implementations§
Source§impl Notification for OverscrollIndicatorNotification
impl Notification for OverscrollIndicatorNotification
Source§fn viewport_depth(&self) -> Option<&Cell<u32>>
fn viewport_depth(&self) -> Option<&Cell<u32>>
ViewportNotificationMixin
(widgets/scroll_notification.rs), for the viewport elements that increment it as
the notification bubbles past them; None — the default — for every other
notification. Read moreSource§fn as_scroll_notification(&self) -> Option<&dyn ScrollNotification>
fn as_scroll_notification(&self) -> Option<&dyn ScrollNotification>
ScrollNotification (widgets/scroll_notification.rs), for a
NotificationListener<dyn ScrollNotification>; None — the default — for every
other notification. Read moreSource§fn as_layout_changed_notification(
&self,
) -> Option<&dyn LayoutChangedNotification>
fn as_layout_changed_notification( &self, ) -> Option<&dyn LayoutChangedNotification>
LayoutChangedNotification
(widgets/notification_listener.rs), for a
NotificationListener<dyn LayoutChangedNotification>; None — the default — for every
other notification. Read moreSource§impl ViewportNotificationMixin for OverscrollIndicatorNotification
impl ViewportNotificationMixin for OverscrollIndicatorNotification
Source§fn viewport_notification_data(&self) -> &ViewportNotificationData
fn viewport_notification_data(&self) -> &ViewportNotificationData
viewport_notification.