[][src]Struct druid::widget::Scroll

pub struct Scroll<T, W> { /* fields omitted */ }

A container that scrolls its contents.

This container holds a single child, and uses the wheel to scroll it when the child's bounds are larger than the viewport.

The child is laid out with completely unconstrained layout bounds.

Methods

impl<T, W: Widget<T>> Scroll<T, W>[src]

pub fn new(child: W) -> Scroll<T, W>[src]

Create a new scroll container.

This method will allow scrolling in all directions if child's bounds are larger than the viewport. Use vertical and horizontal methods to limit scroll behavior.

pub fn vertical(self) -> Self[src]

Limit scroll behavior to allow only vertical scrolling (Y-axis). The child is laid out with constrained width and infinite height.

pub fn horizontal(self) -> Self[src]

Limit scroll behavior to allow only horizontal scrolling (X-axis). The child is laid out with constrained height and infinite width.

pub fn child(&self) -> &W[src]

Returns a reference to the child widget.

pub fn child_mut(&mut self) -> &mut W[src]

Returns a mutable reference to the child widget.

pub fn scroll(&mut self, delta: Vec2, size: Size) -> bool[src]

Update the scroll.

Returns true if the scroll has been updated.

pub fn reset_scrollbar_fade(&mut self, ctx: &mut EventCtx, env: &Env)[src]

Makes the scrollbars visible, and resets the fade timer.

pub fn offset(&self) -> Vec2[src]

Returns the current scroll offset.

Trait Implementations

impl<T: Data, W: Widget<T>> Widget<T> for Scroll<T, W>[src]

Auto Trait Implementations

impl<T, W> !RefUnwindSafe for Scroll<T, W>

impl<T, W> !Send for Scroll<T, W>

impl<T, W> !Sync for Scroll<T, W>

impl<T, W> Unpin for Scroll<T, W> where
    T: Unpin,
    W: Unpin

impl<T, W> !UnwindSafe for Scroll<T, W>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> RoundFrom<T> for T

impl<T, U> RoundInto<U> for T where
    U: RoundFrom<T>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.