Struct conrod::scroll::State [] [src]

pub struct State {
    pub maybe_vertical: Option<Bar>,
    pub maybe_horizontal: Option<Bar>,
    pub visible: Rect,
    pub total_dim: Dimensions,
    pub thickness: Scalar,
    pub color: Color,
}

State related to scrolling.

Fields

maybe_vertical: Option<Bar>

vertical scrollbar.

maybe_horizontal: Option<Bar>

Horizontal scrollbar.

visible: Rect

The rectangle representing the Visible area used tot calculate the Bar offsets.

total_dim: Dimensions

The dimensions of the maximum bounding box around both the visible and kids Rects.

thickness: Scalar

The width for vertical scrollbars, the height for horizontal scrollbars.

color: Color

The color of the scrollbar.

Methods

impl State
[src]

fn new(scrolling: Scrolling, visible: Rect, kids: Rect, theme: &Theme, maybe_prev: Option<&State>) -> State

Construct a new State. The visible rect corresponds to a Widget's kid_area aka the viewable container. The kids rect is the area actually occupied by the children widgets.

fn handle_input(self, mouse: Mouse) -> State

Given some mouse input, update the State and return the resulting State.

fn is_over(&self, target_xy: Point) -> bool

Is the given xy over either scroll Bars.

fn kids_pos_offset(&self) -> Dimensions

Converts the Bars' current offset to a positional offset along its visible area.

Trait Implementations

impl PartialEq for State
[src]

fn eq(&self, __arg_0: &State) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &State) -> bool

This method tests for !=.

impl Debug for State
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Clone for State
[src]

fn clone(&self) -> State

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Copy for State
[src]