Struct OverlayScrollbar
pub struct OverlayScrollbar { /* private fields */ }Expand description
A vertical overlay scroll bar. The host keeps its own offset and gives
the bar the area it scrolls (Self::track) and its ScrollMetrics
each time; the bar keeps the drag, the hover and the idle fade, and the
theme’s sizes and motion policy as last given (Self::set_theme).
Implementations§
§impl OverlayScrollbar
impl OverlayScrollbar
pub fn vertical() -> OverlayScrollbar
pub fn vertical() -> OverlayScrollbar
A vertical bar along the trailing edge, at the default theme’s sizes.
pub fn lane(&self, area: Rect) -> Rect
pub fn lane(&self, area: Rect) -> Rect
The lane along the trailing edge of area the bar lies in, over
the content: the pointer there holds the bar shown.
pub fn wake(&self)
pub fn wake(&self)
Show the bar now, as a scroll does.
pub fn note_offset(&self, offset: f64)
pub fn note_offset(&self, offset: f64)
Note the offset the content is shown at; a change since the last one shows the bar, whatever moved it (the wheel, a key, the bar).
pub fn update_pointer(
&mut self,
area: Rect,
metrics: ScrollMetrics,
cursor: Point,
) -> bool
pub fn update_pointer( &mut self, area: Rect, metrics: ScrollMetrics, cursor: Point, ) -> bool
Follow the pointer at cursor over area: the thumb under it
brightens and the bar stays shown while it is in the lane. Returns
whether anything the bar paints changed.
pub fn pointer_left(&mut self) -> bool
pub fn pointer_left(&mut self) -> bool
The pointer left: the bar fades as at rest. Returns whether anything the bar paints changed.
pub fn press(
&mut self,
area: Rect,
metrics: ScrollMetrics,
cursor: Point,
) -> PressOutcome
pub fn press( &mut self, area: Rect, metrics: ScrollMetrics, cursor: Point, ) -> PressOutcome
A press at cursor on the bar over area; see
Scrollbar::press. A bar that has faded out takes none.
pub fn drag_to(
&self,
area: Rect,
metrics: ScrollMetrics,
cursor: Point,
) -> Option<f64>
pub fn drag_to( &self, area: Rect, metrics: ScrollMetrics, cursor: Point, ) -> Option<f64>
The offset a drag in progress asks for; see Scrollbar::drag_to.
pub fn is_dragging(&self) -> bool
pub fn is_dragging(&self) -> bool
Whether the thumb is being dragged.
pub fn paint(
&self,
scene: &mut Scene,
transform: Affine,
area: Rect,
metrics: ScrollMetrics,
theme: &Theme,
)
pub fn paint( &self, scene: &mut Scene, transform: Affine, area: Rect, metrics: ScrollMetrics, theme: &Theme, )
Paint the thumb over area for metrics, faded as the bar is now.
Paints nothing while the content fits or the bar has faded out.
pub fn needs_animation_frame(&self) -> bool
pub fn needs_animation_frame(&self) -> bool
Whether the fade needs frames now, for the host’s
needs_animation_frame.
pub fn next_wake_deadline(&self) -> Option<Instant>
pub fn next_wake_deadline(&self) -> Option<Instant>
When the fade starts, for the host’s next_wake_deadline.
Trait Implementations§
§impl Debug for OverlayScrollbar
impl Debug for OverlayScrollbar
§impl Default for OverlayScrollbar
impl Default for OverlayScrollbar
§fn default() -> OverlayScrollbar
fn default() -> OverlayScrollbar
Auto Trait Implementations§
impl !Freeze for OverlayScrollbar
impl !RefUnwindSafe for OverlayScrollbar
impl Send for OverlayScrollbar
impl !Sync for OverlayScrollbar
impl Unpin for OverlayScrollbar
impl UnsafeUnpin for OverlayScrollbar
impl UnwindSafe for OverlayScrollbar
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§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>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§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.§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.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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