[][src]Struct cursive::views::PaddedView

pub struct PaddedView<V> { /* fields omitted */ }

Adds padding to another view.

This view wraps another view and adds some padding.

The wrapped view will see a reduced space available.

Examples

// Adds 2 columns of padding to the left and to the right.
let view = PaddedView::new(
    ((2,2), (0,0)), // ((left, right), (top, bottom))
    TextView::new("Padded text")
);

Methods

impl<V: View> PaddedView<V>[src]

pub fn new<M: Into<Margins>>(margins: M, view: V) -> Self[src]

Wraps view in a new PaddedView with the given margins.

pub fn set_margins<M: Into<Margins>>(&mut self, margins: M)[src]

Sets the margins for this view.

Trait Implementations

impl<V: View> ViewWrapper for PaddedView<V>[src]

type V = V

Type that this view wraps.

fn wrap_take_focus(&mut self, source: Direction) -> bool[src]

Wraps the take_focus method.

fn wrap_call_on_any<'a>(&mut self, selector: &Selector, callback: AnyCb<'a>)[src]

Wraps the find method.

fn wrap_focus_view(&mut self, selector: &Selector) -> Result<(), ()>[src]

Wraps the focus_view method.

fn wrap_needs_relayout(&self) -> bool[src]

Wraps the needs_relayout method.

fn wrap_important_area(&self, size: Vec2) -> Rect[src]

Wraps the important_area method.

Auto Trait Implementations

impl<V> Unpin for PaddedView<V> where
    V: Unpin

impl<V> Sync for PaddedView<V> where
    V: Sync

impl<V> Send for PaddedView<V> where
    V: Send

impl<V> UnwindSafe for PaddedView<V> where
    V: UnwindSafe

impl<V> RefUnwindSafe for PaddedView<V> where
    V: RefUnwindSafe

Blanket Implementations

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Erased for T[src]