Struct GridLayout

Source
pub struct GridLayout { /* private fields */ }
Expand description

This is the GridLayout storage structure for the GridLayout implementation.

Implementations§

Source§

impl GridLayout

Creates a new GridLayout manager.

Source

pub fn new( _x: i32, _y: i32, _w: u32, _h: u32, _layout: Vec<i32>, padding: PaddingConstraint, ) -> Self

Trait Implementations§

Source§

impl Layout for GridLayout

This is the Layout implementation for the GridLayout manager. This Layout manager will not reposition any objects within the bounds of the Layout until at least 2 objects have been added to the bounds of the Layout.

Source§

fn insert_widget(&mut self, _widget_id: i32, _widget_position: LayoutPosition)

Adds a widget to the HorizontalLayout managed stack.

Source§

fn append_widget(&mut self, _widget_id: i32)

Appends a widget to the HorizontalLayout managed stack.

Source§

fn do_layout(&mut self, _widgets: &[WidgetContainer])

Adjusts the layout of the Widgets managed by this Layout manager. Currently only obeys the spacing in the object. The rest of the padding is not (yet) honored.

Source§

fn set_padding(&mut self, padding: PaddingConstraint)

Changes the PaddingConstraint for this Layout.
Source§

fn get_padding(&self) -> PaddingConstraint

Retrieves the current PaddingConstraint.
Source§

fn needs_layout(&self) -> bool

Indicates whether or not the Layout needs to have do_layout re-run. This is generally needed when the LayoutPosition changes, or when PaddingConstraints change.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.