[−][src]Struct cursive::views::HideableView
Wrapper around another view that can be hidden at will.
By default, it simply forwards all calls to the inner view.
When hidden (with HideableView::hide()
), it will appear as a zero-sized
invisible view, will not take focus and will not accept input.
It can be made visible again with HideableView::unhide()
.
Methods
impl<V> HideableView<V>
[src]
pub fn new(view: V) -> Self
[src]
Creates a new HideableView around view
.
It will be visible by default.
pub fn set_visible(&mut self, visible: bool)
[src]
Sets the visibility for this view.
pub fn hide(&mut self)
[src]
Sets the visibility for this view to false
.
pub fn unhide(&mut self)
[src]
Sets the visibility for this view to true
.
[src]
Sets the visibility for this view to false
.
Chainable variant.
pub fn is_visible(&self) -> bool
[src]
Returns true
if the wrapped view is going to be visible.
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 HideableView<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 wrap_call_on_any<'a>(
&mut self,
selector: &Selector,
callback: Box<dyn FnMut(&mut dyn Any) + 'a>
)
[src]
&mut self,
selector: &Selector,
callback: Box<dyn FnMut(&mut dyn Any) + 'a>
)
fn into_inner(self) -> Result<Self::V, Self> where
Self: Sized,
Self::V: Sized,
[src]
Self: Sized,
Self::V: Sized,
fn wrap_layout(&mut self, size: Vec2)
[src]
fn wrap_needs_relayout(&self) -> bool
[src]
fn wrap_draw(&self, printer: &Printer)
[src]
Wraps the draw
method.
fn wrap_required_size(&mut self, req: Vec2) -> Vec2
[src]
Wraps the required_size
method.
fn wrap_on_event(&mut self, ch: Event) -> EventResult
[src]
Wraps the on_event
method.
fn wrap_take_focus(&mut self, source: Direction) -> bool
[src]
Wraps the take_focus
method.
fn wrap_focus_view(&mut self, selector: &Selector) -> Result<(), ()>
[src]
Wraps the focus_view
method.
fn wrap_important_area(&self, size: Vec2) -> Rect
[src]
Wraps the important_area
method.
Auto Trait Implementations
impl<V> Send for HideableView<V> where
V: Send,
V: Send,
impl<V> Sync for HideableView<V> where
V: Sync,
V: Sync,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.