pub struct Flexbox { /* private fields */ }
Expand description
A container that can be used to display a list of items in a flexible way.
Implementations§
Source§impl Flexbox
impl Flexbox
Sourcepub fn set_flex_grow(&mut self, index: usize, flex_grow: u8)
pub fn set_flex_grow(&mut self, index: usize, flex_grow: u8)
Sourcepub fn main_axis_gap(&self) -> u32
pub fn main_axis_gap(&self) -> u32
Gap between items on the main axis.
Sourcepub fn set_main_axis_gap(&mut self, gap: u32)
pub fn set_main_axis_gap(&mut self, gap: u32)
Set the fixed gap between elements on the main axis.
Sourcepub fn cross_axis_gap(&self) -> u32
pub fn cross_axis_gap(&self) -> u32
Gap between the main axes.
Sourcepub fn set_cross_axis_gap(&mut self, gap: u32)
pub fn set_cross_axis_gap(&mut self, gap: u32)
Set the fixed gap between the main axes.
Sourcepub fn justify_content(&self) -> JustifyContent
pub fn justify_content(&self) -> JustifyContent
Get the justify-content option.
Sourcepub fn set_justify_content(&mut self, justify_content: JustifyContent)
pub fn set_justify_content(&mut self, justify_content: JustifyContent)
Set the justify-content option.
Sourcepub fn align_items(&self) -> AlignItems
pub fn align_items(&self) -> AlignItems
Get the align-items option.
Sourcepub fn set_align_items(&mut self, item_alignment: AlignItems)
pub fn set_align_items(&mut self, item_alignment: AlignItems)
Set the align-items option.
Sourcepub fn align_content(&self) -> AlignContent
pub fn align_content(&self) -> AlignContent
Get the align-content option.
Sourcepub fn set_align_content(&mut self, axes_alignment: AlignContent)
pub fn set_align_content(&mut self, axes_alignment: AlignContent)
Set the align-content option.
Sourcepub fn flex_direction(&self) -> FlexDirection
pub fn flex_direction(&self) -> FlexDirection
Get the flex-direction option.
Sourcepub fn set_flex_direction(&mut self, direction: FlexDirection)
pub fn set_flex_direction(&mut self, direction: FlexDirection)
Set the direction of the main axis.
Sourcepub fn set_flex_wrap(&mut self, wrap: FlexWrap)
pub fn set_flex_wrap(&mut self, wrap: FlexWrap)
Set the wrapping behavior.
Trait Implementations§
Source§impl View for Flexbox
impl View for Flexbox
Source§fn layout(&mut self, printer_size: Vec2)
fn layout(&mut self, printer_size: Vec2)
Called when the final size has been determined. printer_size
will be the actual size of
the printer given to draw()
. This should call layout on all child items with their
respective sizes.
Source§fn needs_relayout(&self) -> bool
fn needs_relayout(&self) -> bool
Return true if this view needs a relayout before the next call to draw()
. If the view’s
layout is somehow cached, returning true here will cause layout()
to be called so the new
layout can be computed.
Source§fn required_size(&mut self, constraint: Vec2) -> Vec2
fn required_size(&mut self, constraint: Vec2) -> Vec2
Given constraint
, return the minimal required size the printer for this view should be.
constraint
is the maximum possible size for the printer.
Source§fn on_event(&mut self, event: Event) -> EventResult
fn on_event(&mut self, event: Event) -> EventResult
Source§fn focus_view(
&mut self,
selector: &Selector<'_>,
) -> Result<EventResult, ViewNotFound>
fn focus_view( &mut self, selector: &Selector<'_>, ) -> Result<EventResult, ViewNotFound>
Source§fn call_on_any(&mut self, selector: &Selector<'_>, callback: AnyCb<'_>)
fn call_on_any(&mut self, selector: &Selector<'_>, callback: AnyCb<'_>)
Source§fn take_focus(&mut self, _source: Direction) -> Result<EventResult, CannotFocus>
fn take_focus(&mut self, _source: Direction) -> Result<EventResult, CannotFocus>
Auto Trait Implementations§
impl Freeze for Flexbox
impl !RefUnwindSafe for Flexbox
impl !Send for Flexbox
impl !Sync for Flexbox
impl Unpin for Flexbox
impl !UnwindSafe for Flexbox
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Finder for Twhere
T: View,
impl<T> Finder for Twhere
T: View,
Source§fn call_on_all<V, F>(&mut self, sel: &Selector<'_>, callback: F)
fn call_on_all<V, F>(&mut self, sel: &Selector<'_>, callback: F)
sel
. Read moreSource§fn call_on<V, F, R>(&mut self, sel: &Selector<'_>, callback: F) -> Option<R>
fn call_on<V, F, R>(&mut self, sel: &Selector<'_>, callback: F) -> Option<R>
sel
. Read moreSource§fn call_on_name<V, F, R>(&mut self, name: &str, callback: F) -> Option<R>
fn call_on_name<V, F, R>(&mut self, name: &str, callback: F) -> Option<R>
call_on
with a view::Selector::Name
.Source§impl<T> IntoBoxedView for Twhere
T: View,
impl<T> IntoBoxedView for Twhere
T: View,
Source§fn into_boxed_view(self) -> Box<dyn View>
fn into_boxed_view(self) -> Box<dyn View>
Box<View>
.Source§impl<T> Resizable for Twhere
T: View,
impl<T> Resizable for Twhere
T: View,
Source§fn resized(
self,
width: SizeConstraint,
height: SizeConstraint,
) -> ResizedView<Self>
fn resized( self, width: SizeConstraint, height: SizeConstraint, ) -> ResizedView<Self>
self
in a ResizedView
with the given size constraints.Source§fn fixed_size<S>(self, size: S) -> ResizedView<Self>
fn fixed_size<S>(self, size: S) -> ResizedView<Self>
self
into a fixed-size ResizedView
.Source§fn fixed_width(self, width: usize) -> ResizedView<Self>
fn fixed_width(self, width: usize) -> ResizedView<Self>
self
into a fixed-width ResizedView
.Source§fn fixed_height(self, height: usize) -> ResizedView<Self>
fn fixed_height(self, height: usize) -> ResizedView<Self>
self
into a fixed-width ResizedView
.Source§fn full_screen(self) -> ResizedView<Self>
fn full_screen(self) -> ResizedView<Self>
self
into a full-screen ResizedView
.Source§fn full_width(self) -> ResizedView<Self>
fn full_width(self) -> ResizedView<Self>
self
into a full-width ResizedView
.Source§fn full_height(self) -> ResizedView<Self>
fn full_height(self) -> ResizedView<Self>
self
into a full-height ResizedView
.Source§fn max_size<S>(self, size: S) -> ResizedView<Self>
fn max_size<S>(self, size: S) -> ResizedView<Self>
self
into a limited-size ResizedView
.Source§fn max_width(self, max_width: usize) -> ResizedView<Self>
fn max_width(self, max_width: usize) -> ResizedView<Self>
self
into a limited-width ResizedView
.Source§fn max_height(self, max_height: usize) -> ResizedView<Self>
fn max_height(self, max_height: usize) -> ResizedView<Self>
self
into a limited-height ResizedView
.Source§fn min_size<S>(self, size: S) -> ResizedView<Self>
fn min_size<S>(self, size: S) -> ResizedView<Self>
self
into a ResizedView
at least sized size
.Source§fn min_width(self, min_width: usize) -> ResizedView<Self>
fn min_width(self, min_width: usize) -> ResizedView<Self>
self
in a ResizedView
at least min_width
wide.Source§fn min_height(self, min_height: usize) -> ResizedView<Self>
fn min_height(self, min_height: usize) -> ResizedView<Self>
self
in a ResizedView
at least min_height
tall.Source§impl<T> Scrollable for Twhere
T: View,
impl<T> Scrollable for Twhere
T: View,
Source§fn scrollable(self) -> ScrollView<Self>
fn scrollable(self) -> ScrollView<Self>
self
in a ScrollView
.