Trait conrod::Positionable [] [src]

pub trait Positionable: Sized {
    fn position(self, pos: Position) -> Self;
    fn get_position(&self, theme: &Theme) -> Position;
    fn horizontal_align(self, align: HorizontalAlign) -> Self;
    fn vertical_align(self, align: VerticalAlign) -> Self;
    fn get_horizontal_align(&self, theme: &Theme) -> HorizontalAlign;
    fn get_vertical_align(&self, theme: &Theme) -> VerticalAlign;
    fn depth(self, depth: Depth) -> Self;
    fn get_depth(&self) -> Depth;

    fn point(self, point: Point) -> Self { ... }
    fn xy(self, x: Scalar, y: Scalar) -> Self { ... }
    fn relative(self, point: Point) -> Self { ... }
    fn relative_xy(self, x: Scalar, y: Scalar) -> Self { ... }
    fn relative_to<I: Into<Index>>(self, other: I, point: Point) -> Self { ... }
    fn relative_xy_to<I: Into<Index>>(self, other: I, x: Scalar, y: Scalar) -> Self { ... }
    fn down(self, pixels: Scalar) -> Self { ... }
    fn up(self, pixels: Scalar) -> Self { ... }
    fn left(self, pixels: Scalar) -> Self { ... }
    fn right(self, pixels: Scalar) -> Self { ... }
    fn down_from<I: Into<Index>>(self, other: I, pixels: Scalar) -> Self { ... }
    fn up_from<I: Into<Index>>(self, other: I, pixels: Scalar) -> Self { ... }
    fn left_from<I: Into<Index>>(self, other: I, pixels: Scalar) -> Self { ... }
    fn right_from<I: Into<Index>>(self, other: I, pixels: Scalar) -> Self { ... }
    fn get_alignment(&self, theme: &Theme) -> (HorizontalAlign, VerticalAlign) { ... }
    fn align_left(self) -> Self { ... }
    fn align_middle_x(self) -> Self { ... }
    fn align_right(self) -> Self { ... }
    fn align_top(self) -> Self { ... }
    fn align_middle_y(self) -> Self { ... }
    fn align_bottom(self) -> Self { ... }
    fn align_left_of<I: Into<Index>>(self, other: I) -> Self { ... }
    fn align_middle_x_of<I: Into<Index>>(self, other: I) -> Self { ... }
    fn align_right_of<I: Into<Index>>(self, other: I) -> Self { ... }
    fn align_top_of<I: Into<Index>>(self, other: I) -> Self { ... }
    fn align_middle_y_of<I: Into<Index>>(self, other: I) -> Self { ... }
    fn align_bottom_of<I: Into<Index>>(self, other: I) -> Self { ... }
    fn place(self, place: Place, maybe_idx: Option<Index>) -> Self { ... }
    fn middle_of<I: Into<Index>>(self, other: I) -> Self { ... }
    fn top_left_of<I: Into<Index>>(self, other: I) -> Self { ... }
    fn top_right_of<I: Into<Index>>(self, other: I) -> Self { ... }
    fn bottom_left_of<I: Into<Index>>(self, other: I) -> Self { ... }
    fn bottom_right_of<I: Into<Index>>(self, other: I) -> Self { ... }
    fn mid_top_of<I: Into<Index>>(self, other: I) -> Self { ... }
    fn mid_bottom_of<I: Into<Index>>(self, other: I) -> Self { ... }
    fn mid_left_of<I: Into<Index>>(self, other: I) -> Self { ... }
    fn mid_right_of<I: Into<Index>>(self, other: I) -> Self { ... }
    fn middle(self) -> Self { ... }
    fn top_left(self) -> Self { ... }
    fn top_right(self) -> Self { ... }
    fn bottom_left(self) -> Self { ... }
    fn bottom_right(self) -> Self { ... }
    fn mid_top(self) -> Self { ... }
    fn mid_bottom(self) -> Self { ... }
    fn mid_left(self) -> Self { ... }
    fn mid_right(self) -> Self { ... }
}

Widgets that are positionable.

Required Methods

fn position(self, pos: Position) -> Self

Set the Position.

fn get_position(&self, theme: &Theme) -> Position

Get the Position.

fn horizontal_align(self, align: HorizontalAlign) -> Self

Align the position horizontally (only effective for Up or Down Directions).

fn vertical_align(self, align: VerticalAlign) -> Self

Align the position vertically (only effective for Left or Right Directions).

fn get_horizontal_align(&self, theme: &Theme) -> HorizontalAlign

Return the horizontal alignment.

fn get_vertical_align(&self, theme: &Theme) -> VerticalAlign

Return the vertical alignment.

fn depth(self, depth: Depth) -> Self

The depth at which the widget should be rendered.

fn get_depth(&self) -> Depth

Return the depth.

Provided Methods

fn point(self, point: Point) -> Self

Set the position with some Point.

fn xy(self, x: Scalar, y: Scalar) -> Self

Set the position with XY co-ords.

fn relative(self, point: Point) -> Self

Set the point relative to the previous widget.

fn relative_xy(self, x: Scalar, y: Scalar) -> Self

Set the xy relative to the previous widget.

fn relative_to<I: Into<Index>>(self, other: I, point: Point) -> Self

Set the position relative to the widget with the given widget::Index.

fn relative_xy_to<I: Into<Index>>(self, other: I, x: Scalar, y: Scalar) -> Self

Set the position relative to the widget with the given widget::Index.

fn down(self, pixels: Scalar) -> Self

Set the position as below the previous widget.

fn up(self, pixels: Scalar) -> Self

Set the position as above the previous widget.

fn left(self, pixels: Scalar) -> Self

Set the position to the left of the previous widget.

fn right(self, pixels: Scalar) -> Self

Set the position to the right of the previous widget.

fn down_from<I: Into<Index>>(self, other: I, pixels: Scalar) -> Self

Set the position as below the widget with the given widget::Index.

fn up_from<I: Into<Index>>(self, other: I, pixels: Scalar) -> Self

Set the position as above the widget with the given widget::Index.

fn left_from<I: Into<Index>>(self, other: I, pixels: Scalar) -> Self

Set the position to the left of the widget with the given widget::Index.

fn right_from<I: Into<Index>>(self, other: I, pixels: Scalar) -> Self

Set the position to the right of the widget with the given widget::Index.

fn get_alignment(&self, theme: &Theme) -> (HorizontalAlign, VerticalAlign)

Return the alignment of both axis.

fn align_left(self) -> Self

Align the position to the left (only effective for Up or Down Directions).

fn align_middle_x(self) -> Self

Align the position to the middle (only effective for Up or Down Directions).

fn align_right(self) -> Self

Align the position to the right (only effective for Up or Down Directions).

fn align_top(self) -> Self

Align the position to the top (only effective for Left or Right Directions).

fn align_middle_y(self) -> Self

Align the position to the middle (only effective for Left or Right Directions).

fn align_bottom(self) -> Self

Align the position to the bottom (only effective for Left or Right Directions).

fn align_left_of<I: Into<Index>>(self, other: I) -> Self

Align the position to the left (only effective for Up or Down Directions).

fn align_middle_x_of<I: Into<Index>>(self, other: I) -> Self

Align the position to the middle (only effective for Up or Down Directions).

fn align_right_of<I: Into<Index>>(self, other: I) -> Self

Align the position to the right (only effective for Up or Down Directions).

fn align_top_of<I: Into<Index>>(self, other: I) -> Self

Align the position to the top (only effective for Left or Right Directions).

fn align_middle_y_of<I: Into<Index>>(self, other: I) -> Self

Align the position to the middle (only effective for Left or Right Directions).

fn align_bottom_of<I: Into<Index>>(self, other: I) -> Self

Align the position to the bottom (only effective for Left or Right Directions).

fn place(self, place: Place, maybe_idx: Option<Index>) -> Self

Place the widget at some position on the Widget.

fn middle_of<I: Into<Index>>(self, other: I) -> Self

Place the widget in the middle of the given Widget.

fn top_left_of<I: Into<Index>>(self, other: I) -> Self

Place the widget in the top left corner of the given Widget.

fn top_right_of<I: Into<Index>>(self, other: I) -> Self

Place the widget in the top right corner of the given Widget.

fn bottom_left_of<I: Into<Index>>(self, other: I) -> Self

Place the widget in the bottom left corner of the given Widget.

fn bottom_right_of<I: Into<Index>>(self, other: I) -> Self

Place the widget in the bottom right corner of the given Widget.

fn mid_top_of<I: Into<Index>>(self, other: I) -> Self

Place the widget in the middle of the top edge of the given Widget.

fn mid_bottom_of<I: Into<Index>>(self, other: I) -> Self

Place the widget in the middle of the bottom edge of the given Widget.

fn mid_left_of<I: Into<Index>>(self, other: I) -> Self

Place the widget in the middle of the left edge of the given Widget.

fn mid_right_of<I: Into<Index>>(self, other: I) -> Self

Place the widget in the middle of the right edge of the given Widget.

fn middle(self) -> Self

Place the widget in the middle of the current parent Widget.

fn top_left(self) -> Self

Place the widget in the top left corner of the current parent Widget.

fn top_right(self) -> Self

Place the widget in the top right corner of the current parent Widget.

fn bottom_left(self) -> Self

Place the widget in the bottom left corner of the current parent Widget.

fn bottom_right(self) -> Self

Place the widget in the bottom right corner of the current parent Widget.

fn mid_top(self) -> Self

Place the widget in the middle of the top edge of the current parent Widget.

fn mid_bottom(self) -> Self

Place the widget in the middle of the bottom edge of the current parent Widget.

fn mid_left(self) -> Self

Place the widget in the middle of the left edge of the current parent Widget.

fn mid_right(self) -> Self

Place the widget in the middle of the right edge of the current parent Widget.

Implementors