[][src]Struct fui::cursive::views::LinearLayout

pub struct LinearLayout { /* fields omitted */ }

Arranges its children linearly according to its orientation.

Methods

impl LinearLayout[src]

pub fn new(orientation: Orientation) -> LinearLayout[src]

Creates a new layout with the given orientation.

pub fn set_weight(&mut self, i: usize, weight: usize)[src]

Sets the weight of the given child.

Panics

Panics if i >= self.len().

pub fn weight(self, weight: usize) -> LinearLayout[src]

Modifies the weight of the last child added.

It is an error to call this before adding a child (and it will panic).

pub fn child<V>(self, view: V) -> LinearLayout where
    V: 'static + View
[src]

Adds a child to the layout.

Chainable variant.

pub fn add_child<V>(&mut self, view: V) where
    V: 'static + View
[src]

Adds a child to the layout.

pub fn insert_child<V>(&mut self, i: usize, view: V) where
    V: 'static + View
[src]

Inserts a child at the given position.

Panics

Panics if i > self.len().

pub fn swap_children(&mut self, i: usize, j: usize)[src]

Swaps two children.

pub fn len(&self) -> usize[src]

Returns the number of children.

pub fn is_empty(&self) -> bool[src]

Returns true if this view has no children.

pub fn get_focus_index(&self) -> usize[src]

Returns index of focused inner view

pub fn vertical() -> LinearLayout[src]

Creates a new vertical layout.

pub fn horizontal() -> LinearLayout[src]

Creates a new horizontal layout.

pub fn get_child(&self, i: usize) -> Option<&(dyn View + 'static)>[src]

Returns a reference to a child.

pub fn get_child_mut(&mut self, i: usize) -> Option<&mut (dyn View + 'static)>[src]

Returns a mutable reference to a child.

pub fn remove_child(&mut self, i: usize) -> Option<Box<dyn View + 'static>>[src]

Removes a child.

If i is within bounds, the removed child will be returned.

Trait Implementations

impl View for LinearLayout[src]

Auto Trait Implementations

impl !Send for LinearLayout

impl !Sync for LinearLayout

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> View for T where
    T: ViewWrapper
[src]

impl<T> With for T[src]

fn with<F>(self, f: F) -> Self where
    F: FnOnce(&mut Self), 
[src]

Calls the given closure on self.

fn try_with<E, F>(self, f: F) -> Result<Self, E> where
    F: FnOnce(&mut Self) -> Result<(), E>, 
[src]

Calls the given closure on self.

fn with_if<F>(self, condition: bool, f: F) -> Self where
    F: FnOnce(&mut Self), 
[src]

Calls the given closure if condition == true.

impl<T> Identifiable for T where
    T: View
[src]

fn with_id<S>(self, id: S) -> IdView<Self> where
    S: Into<String>, 
[src]

Wraps this view into an IdView with the given id. Read more

impl<T> Finder for T where
    T: View
[src]

fn call_on_id<V, F, R>(&mut self, id: &str, callback: F) -> Option<R> where
    F: FnOnce(&mut V) -> R,
    V: View + Any
[src]

Convenient method to use call_on with a view::Selector::Id.

fn find_id<V>(
    &mut self,
    id: &str
) -> Option<OwningHandle<OwningRef<Rc<RefCell<V>>, RefCell<V>>, RefMut<'static, V>>> where
    V: View + Any
[src]

Convenient method to find a view wrapped in an [IdView]. Read more

impl<T> Boxable for T where
    T: View
[src]

fn boxed(self, width: SizeConstraint, height: SizeConstraint) -> BoxView<Self>[src]

Wraps self in a BoxView with the given size constraints.

fn fixed_size<S>(self, size: S) -> BoxView<Self> where
    S: Into<XY<usize>>, 
[src]

Wraps self into a fixed-size BoxView.

fn fixed_width(self, width: usize) -> BoxView<Self>[src]

Wraps self into a fixed-width BoxView.

fn fixed_height(self, height: usize) -> BoxView<Self>[src]

Wraps self into a fixed-width BoxView.

fn full_screen(self) -> BoxView<Self>[src]

Wraps self into a full-screen BoxView.

fn full_width(self) -> BoxView<Self>[src]

Wraps self into a full-width BoxView.

fn full_height(self) -> BoxView<Self>[src]

Wraps self into a full-height BoxView.

fn max_size<S>(self, size: S) -> BoxView<Self> where
    S: Into<XY<usize>>, 
[src]

Wraps self into a limited-size BoxView.

fn max_width(self, max_width: usize) -> BoxView<Self>[src]

Wraps self into a limited-width BoxView.

fn max_height(self, max_height: usize) -> BoxView<Self>[src]

Wraps self into a limited-height BoxView.

fn min_size<S>(self, size: S) -> BoxView<Self> where
    S: Into<XY<usize>>, 
[src]

Wraps self into a BoxView at least sized size.

fn min_width(self, min_width: usize) -> BoxView<Self>[src]

Wraps self in a BoxView at least min_width wide.

fn min_height(self, min_height: usize) -> BoxView<Self>[src]

Wraps self in a BoxView at least min_height tall.

impl<T> Scrollable for T where
    T: View
[src]

fn scrollable(self) -> ScrollView<Self>[src]

Wraps self in a ScrollView.

impl<T> AnyView for T where
    T: View
[src]

fn as_any(&self) -> &(dyn Any + 'static)[src]

Downcast self to a Any.

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)[src]

Downcast self to a mutable Any.

impl<T> IntoBoxedView for T where
    T: View
[src]

impl<T> Erased for T