[−][src]Struct cursive::views::PaddedView
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::lrtb( 2,2,0,0, // Left, Right, Top, Bottom TextView::new("Padded text") );
Methods
impl<V: View> PaddedView<V>
[src]
pub fn new(margins: Margins, view: V) -> Self
[src]
Wraps view
in a new PaddedView
with the given margins.
pub fn lrtb(
left: usize,
right: usize,
top: usize,
bottom: usize,
view: V
) -> Self
[src]
left: usize,
right: usize,
top: usize,
bottom: usize,
view: V
) -> Self
Wraps view
in a new PaddedView
with the given margins.
pub fn set_margins(&mut self, margins: Margins)
[src]
Sets the margins for this view.
pub fn get_inner(&self) -> &V
[src]
Gets access to the inner view.
pub fn get_inner_mut(&mut self) -> &mut V
[src]
Gets mutable access to the inner view.
Trait Implementations
impl<V: View> ViewWrapper for PaddedView<V>
[src]
type V = V
Type that this view wraps.
fn with_view<F, R>(&self, f: F) -> Option<R> where
F: FnOnce(&Self::V) -> R,
[src]
F: FnOnce(&Self::V) -> R,
fn with_view_mut<F, R>(&mut self, f: F) -> Option<R> where
F: FnOnce(&mut Self::V) -> R,
[src]
F: FnOnce(&mut Self::V) -> R,
fn into_inner(self) -> Result<Self::V, Self> where
Self::V: Sized,
[src]
Self::V: Sized,
fn wrap_required_size(&mut self, req: Vec2) -> Vec2
[src]
fn wrap_layout(&mut self, size: Vec2)
[src]
fn wrap_on_event(&mut self, event: Event) -> EventResult
[src]
fn wrap_draw(&self, printer: &Printer)
[src]
fn wrap_take_focus(&mut self, source: Direction) -> bool
[src]
fn wrap_call_on_any<'a>(&mut self, selector: &Selector, callback: AnyCb<'a>)
[src]
fn wrap_focus_view(&mut self, selector: &Selector) -> Result<(), ()>
[src]
fn wrap_needs_relayout(&self) -> bool
[src]
fn wrap_important_area(&self, size: Vec2) -> Rect
[src]
Auto Trait Implementations
impl<V> RefUnwindSafe for PaddedView<V> where
V: RefUnwindSafe,
V: RefUnwindSafe,
impl<V> Send for PaddedView<V> where
V: Send,
V: Send,
impl<V> Sync for PaddedView<V> where
V: Sync,
V: Sync,
impl<V> Unpin for PaddedView<V> where
V: Unpin,
V: Unpin,
impl<V> UnwindSafe for PaddedView<V> where
V: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erased for T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,