Skip to main content

IScrollable

Trait IScrollable 

Source
pub trait IScrollable {
    // Required methods
    fn extent(&self) -> Size;
    fn offset(&self) -> Vector;
    fn set_offset(&self, value: Vector);
    fn viewport(&self) -> Size;
    fn can_horizontally_scroll(&self) -> bool;
    fn can_vertically_scroll(&self) -> bool;
}
Expand description

Interface implemented by scrollable controls.

Upstream this contract lives with the control primitives; it is defined here because directional navigation is its only consumer in the base library so far. An input element exposes it through the as_scrollable virtual member of InputElement.

Required Methods§

Source

fn extent(&self) -> Size

The extent of the scrollable content, in logical units.

Source

fn offset(&self) -> Vector

The current scroll offset, in logical units.

Source

fn set_offset(&self, value: Vector)

Sets the current scroll offset, in logical units.

Source

fn viewport(&self) -> Size

The size of the viewport, in logical units.

Source

fn can_horizontally_scroll(&self) -> bool

Whether the content can be scrolled horizontally.

Source

fn can_vertically_scroll(&self) -> bool

Whether the content can be scrolled vertically.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§