Struct cursive_flexbox::Flexbox
source · 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 !RefUnwindSafe for Flexbox
impl !Send for Flexbox
impl !Sync for Flexbox
impl Unpin for Flexbox
impl !UnwindSafe for Flexbox
Blanket Implementations§
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)where
V: View,
F: FnMut(&mut V),
fn call_on_all<V, F>(&mut self, sel: &Selector<'_>, callback: F)where
V: View,
F: FnMut(&mut V),
sel. Read moresource§fn call_on<V, F, R>(&mut self, sel: &Selector<'_>, callback: F) -> Option<R>where
V: View,
F: FnOnce(&mut V) -> R,
fn call_on<V, F, R>(&mut self, sel: &Selector<'_>, callback: F) -> Option<R>where
V: View,
F: FnOnce(&mut V) -> R,
sel. Read moresource§impl<T> IntoBoxedView for Twhere
T: View,
impl<T> IntoBoxedView for Twhere
T: 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>where
S: Into<XY<usize>>,
fn fixed_size<S>(self, size: S) -> ResizedView<Self>where
S: Into<XY<usize>>,
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>where
S: Into<XY<usize>>,
fn max_size<S>(self, size: S) -> ResizedView<Self>where
S: Into<XY<usize>>,
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>where
S: Into<XY<usize>>,
fn min_size<S>(self, size: S) -> ResizedView<Self>where
S: Into<XY<usize>>,
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.