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(self, other: WidgetId, point: Point) -> Self { ... } fn relative_xy_to(self, other: WidgetId, 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(self, other: WidgetId, pixels: Scalar) -> Self { ... } fn up_from(self, other: WidgetId, pixels: Scalar) -> Self { ... } fn left_from(self, other: WidgetId, pixels: Scalar) -> Self { ... } fn right_from(self, other: WidgetId, 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(self, other: WidgetId) -> Self { ... } fn align_middle_x_of(self, other: WidgetId) -> Self { ... } fn align_right_of(self, other: WidgetId) -> Self { ... } fn align_top_of(self, other: WidgetId) -> Self { ... } fn align_middle_y_of(self, other: WidgetId) -> Self { ... } fn align_bottom_of(self, other: WidgetId) -> Self { ... } fn place(self, place: Place, maybe_id: Option<WidgetId>) -> Self { ... } fn middle_of(self, id: WidgetId) -> Self { ... } fn top_left_of(self, id: WidgetId) -> Self { ... } fn top_right_of(self, id: WidgetId) -> Self { ... } fn bottom_left_of(self, id: WidgetId) -> Self { ... } fn bottom_right_of(self, id: WidgetId) -> Self { ... } fn mid_top_of(self, id: WidgetId) -> Self { ... } fn mid_bottom_of(self, id: WidgetId) -> Self { ... } fn mid_left_of(self, id: WidgetId) -> Self { ... } fn mid_right_of(self, id: WidgetId) -> 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 Direction
s).
fn vertical_align(self, align: VerticalAlign) -> Self
Align the position vertically (only effective for Left or Right Direction
s).
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(self, other: WidgetId, point: Point) -> Self
Set the position relative to the widget with the given WidgetId.
fn relative_xy_to(self, other: WidgetId, x: Scalar, y: Scalar) -> Self
Set the position relative to the widget with the given WidgetId.
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(self, other: WidgetId, pixels: Scalar) -> Self
Set the position as below the widget with the given WidgetId.
fn up_from(self, other: WidgetId, pixels: Scalar) -> Self
Set the position as above the widget with the given WidgetId.
fn left_from(self, other: WidgetId, pixels: Scalar) -> Self
Set the position to the left of the widget with the given WidgetId.
fn right_from(self, other: WidgetId, pixels: Scalar) -> Self
Set the position to the right of the widget with the given WidgetId.
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 Direction
s).
fn align_middle_x(self) -> Self
Align the position to the middle (only effective for Up or Down Direction
s).
fn align_right(self) -> Self
Align the position to the right (only effective for Up or Down Direction
s).
fn align_top(self) -> Self
Align the position to the top (only effective for Left or Right Direction
s).
fn align_middle_y(self) -> Self
Align the position to the middle (only effective for Left or Right Direction
s).
fn align_bottom(self) -> Self
Align the position to the bottom (only effective for Left or Right Direction
s).
fn align_left_of(self, other: WidgetId) -> Self
Align the position to the left (only effective for Up or Down Direction
s).
fn align_middle_x_of(self, other: WidgetId) -> Self
Align the position to the middle (only effective for Up or Down Direction
s).
fn align_right_of(self, other: WidgetId) -> Self
Align the position to the right (only effective for Up or Down Direction
s).
fn align_top_of(self, other: WidgetId) -> Self
Align the position to the top (only effective for Left or Right Direction
s).
fn align_middle_y_of(self, other: WidgetId) -> Self
Align the position to the middle (only effective for Left or Right Direction
s).
fn align_bottom_of(self, other: WidgetId) -> Self
Align the position to the bottom (only effective for Left or Right Direction
s).
fn place(self, place: Place, maybe_id: Option<WidgetId>) -> Self
Place the widget at some position on the Widget.
fn middle_of(self, id: WidgetId) -> Self
Place the widget in the middle of the given Widget.
fn top_left_of(self, id: WidgetId) -> Self
Place the widget in the top left corner of the given Widget.
fn top_right_of(self, id: WidgetId) -> Self
Place the widget in the top right corner of the given Widget.
fn bottom_left_of(self, id: WidgetId) -> Self
Place the widget in the bottom left corner of the given Widget.
fn bottom_right_of(self, id: WidgetId) -> Self
Place the widget in the bottom right corner of the given Widget.
fn mid_top_of(self, id: WidgetId) -> Self
Place the widget in the middle of the top edge of the given Widget.
fn mid_bottom_of(self, id: WidgetId) -> Self
Place the widget in the middle of the bottom edge of the given Widget.
fn mid_left_of(self, id: WidgetId) -> Self
Place the widget in the middle of the left edge of the given Widget.
fn mid_right_of(self, id: WidgetId) -> 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.