Struct Column

Source
pub struct Column<T: WidgetList> {
    pub children: T,
    pub space_between: f64,
    pub main_axis_size: MainAxisSize,
    pub main_axis_alignment: MainAxisAlignment,
    pub cross_axis_size: CrossAxisSize,
    pub cross_axis_alignment: CrossAxisAlignment,
}

Fields§

§children: T§space_between: f64§main_axis_size: MainAxisSize§main_axis_alignment: MainAxisAlignment§cross_axis_size: CrossAxisSize§cross_axis_alignment: CrossAxisAlignment

Implementations§

Source§

impl Column<()>

Source

pub fn builder() -> Self

Source§

impl<WidgetList_: WidgetList> Column<WidgetList_>

Source

pub fn children(self, children: impl WidgetList) -> Column<impl WidgetList>

List of children widgets to be laid out by the Column.

§Note

See WidgetList for all the types that you can use as children.

Source

pub fn main_axis_size(self, size: MainAxisSize) -> Self

Whether Column should take full available height or only the minimum to fit children.

§Note

The default is MainAxisSize::Min.

If one of your children is flexible, MainAxisSize of this Column will be the same as if it was set to MainAxisSize::Max.

Source

pub fn main_axis_alignment(self, alignment: MainAxisAlignment) -> Self

Specifies how Column should layout its children on the vertical axis.

§Note

The default is MainAxisAlignment::Start.

Source

pub fn cross_axis_size(self, size: CrossAxisSize) -> Self

Whether Column should take full available width or only the minimum to fit children.

§Note

The default is CrossAxisSize::Min.

Source

pub fn cross_axis_alignment(self, alignment: CrossAxisAlignment) -> Self

Specifies how Column should layout its children on the horizontal axis.

§Note

The default is MainAxisAlignment::Start.

Source

pub fn space_between(self, amount: f64) -> Self

Minimum amount of empty space added between children widgets.

§Note

The default is 0.

Trait Implementations§

Source§

impl<T: WidgetList> CheapEq for Column<T>

Source§

const CHEAP_TO_EQ: bool = false

This associated type is used to avoid recursive comparisons of the whole widget subtree (if one of the fields is itself a widget).
Source§

fn cheap_eq(&self, other: &Self) -> bool

Source§

impl<T: WidgetList> MultiChildWidget for Column<T>

Source§

fn build<'w>(&'w self, _: BuildContext<'w, Self>) -> Vec<Self::Widget<'w>>

Source§

fn layout(&self, ctx: RenderContext<'_, Self>, constraints: Constraints) -> Size

Source§

fn paint( &self, ctx: RenderContext<'_, Self>, canvas: &mut PaintContext<'_>, offset: &Offset, )

Source§

impl<T: WidgetList> RenderState for Column<T>

Source§

impl<T: WidgetList> Widget for Column<T>

Source§

fn unique_type(&self) -> TypeId

Implementation should return the same unique TypeId for given structure definition, even if that structure contains generic parameters. This is used to preserve state between generic widgets.
Source§

fn kind<'frui>(&'frui self) -> WidgetKind<'_>

Source§

impl<T: WidgetList> WidgetDerive for Column<T>

Source§

type Widget<'frui> = impl Widget + 'frui where Self: 'frui

Assuming this trait was derived through #[derive(WidgetKind)] this associated type should be derived automatically by the compiler. This requires that TAIT feature is enabled.

Auto Trait Implementations§

§

impl<T> Freeze for Column<T>
where T: Freeze,

§

impl<T> Immutable for Column<T>
where T: Immutable,

§

impl<T> RefUnwindSafe for Column<T>
where T: RefUnwindSafe,

§

impl<T> Send for Column<T>
where T: Send,

§

impl<T> Sync for Column<T>
where T: Sync,

§

impl<T> Unpin for Column<T>
where T: Unpin,

§

impl<T> UnwindSafe for Column<T>
where T: UnwindSafe,

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> BoxedWidget for T
where T: Widget,

Source§

fn boxed<'a>(self) -> Box<dyn Widget + 'a>
where T: 'a,

Convenience method used to type erase and box a widget.
Source§

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

Source§

const CHEAP_TO_EQ: bool = false

This associated type is used to avoid recursive comparisons of the whole widget subtree (if one of the fields is itself a widget).
Source§

default fn cheap_eq(&self, _: &T) -> bool

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> RoundFrom<T> for T

Source§

fn round_from(x: T) -> T

Source§

impl<T, U> RoundInto<U> for T
where U: RoundFrom<T>,

Source§

fn round_into(self) -> U

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.
Source§

impl<T> WidgetDebug for T

Source§

default fn debug_name(&self) -> &'static str

Source§

fn debug_name_short(&self) -> &'static str

Source§

impl<T> WidgetLocalKey for T

Source§

default fn local_key(&self) -> Option<LocalKeyAny<'_>>

Source§

impl<T> WidgetUniqueType for T

Source§

default fn unique_type(&self) -> TypeId

Source§

impl<T> WidgetUniqueType for T
where T: Widget,