Struct cursive_extras::TabLayer
source · pub struct TabLayer { /* private fields */ }Expand description
A view similar to TabDialog but it fills up all the available space
Best used with Cursive::add_fullscreen_layer()
Implementations§
source§impl TabLayer
impl TabLayer
Add a new button to the view
Add a new button to the view
Chainable variant
Add a button to close the view
Add a button to close the view
Chainable variant
Add buttons to cycle through the tabs
Add buttons to cycle through the tabs
Chainable variant
Add a button to remove the current tab
Add a button to remove the current tab
Chainable variant
Set the alignment of the buttons
Set the alignment of the buttons
Chainable variant
sourcepub fn set_title_align(&mut self, align: HAlign)
pub fn set_title_align(&mut self, align: HAlign)
Set the alignment of the buttons
sourcepub fn title_align(self, align: HAlign) -> Self
pub fn title_align(self, align: HAlign) -> Self
Set the alignment of the buttons
Chainable variant
Remove all the buttons
sourcepub fn cur_view_mut(&mut self) -> Option<&mut BoxedView>
pub fn cur_view_mut(&mut self) -> Option<&mut BoxedView>
Mutable version of cur_view()
sourcepub fn cur_title(&self) -> &str
pub fn cur_title(&self) -> &str
The current tab title
Returns an empty string if the tab dialog is empty
sourcepub fn views_mut(&mut self) -> TabIterMut<'_>
pub fn views_mut(&mut self) -> TabIterMut<'_>
Mutable version of views()
sourcepub fn set_cur_tab(&mut self, id: usize)
pub fn set_cur_tab(&mut self, id: usize)
Set the current tab by ID
sourcepub fn add_tab<V: View>(&mut self, title: &str, view: V) -> usize
pub fn add_tab<V: View>(&mut self, title: &str, view: V) -> usize
Add a new view tab and returns the ID of the new tab
sourcepub fn tab<V: View>(self, title: &str, view: V) -> TabLayer
pub fn tab<V: View>(self, title: &str, view: V) -> TabLayer
Add a new view tab
Chainable version
sourcepub fn remove_tab(&mut self, id: usize)
pub fn remove_tab(&mut self, id: usize)
Delete tab by ID
Trait Implementations§
source§impl View for TabLayer
impl View for TabLayer
source§fn draw(&self, printer: &Printer<'_, '_>)
fn draw(&self, printer: &Printer<'_, '_>)
source§fn layout(&mut self, size: Vec2)
fn layout(&mut self, size: Vec2)
source§fn take_focus(&mut self, source: Direction) -> Result<EventResult, CannotFocus>
fn take_focus(&mut self, source: Direction) -> Result<EventResult, CannotFocus>
source§fn on_event(&mut self, event: Event) -> EventResult
fn on_event(&mut self, event: Event) -> EventResult
source§fn required_size(&mut self, constraint: Vec2) -> Vec2
fn required_size(&mut self, constraint: Vec2) -> Vec2
source§fn needs_relayout(&self) -> bool
fn needs_relayout(&self) -> bool
source§fn focus_view(
&mut self,
sel: &Selector<'_>,
) -> Result<EventResult, ViewNotFound>
fn focus_view( &mut self, sel: &Selector<'_>, ) -> Result<EventResult, ViewNotFound>
source§fn call_on_any(&mut self, sel: &Selector<'_>, cb: AnyCb<'_>)
fn call_on_any(&mut self, sel: &Selector<'_>, cb: AnyCb<'_>)
Auto Trait Implementations§
impl Freeze for TabLayer
impl !RefUnwindSafe for TabLayer
impl Send for TabLayer
impl Sync for TabLayer
impl Unpin for TabLayer
impl !UnwindSafe for TabLayer
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
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)
fn call_on_all<V, F>(&mut self, sel: &Selector<'_>, callback: F)
sel. Read moresource§fn call_on<V, F, R>(&mut self, sel: &Selector<'_>, callback: F) -> Option<R>
fn call_on<V, F, R>(&mut self, sel: &Selector<'_>, callback: F) -> Option<R>
sel. Read moresource§fn call_on_name<V, F, R>(&mut self, name: &str, callback: F) -> Option<R>
fn call_on_name<V, F, R>(&mut self, name: &str, callback: F) -> Option<R>
call_on with a view::Selector::Name.source§impl<T> IntoBoxedView for Twhere
T: View,
impl<T> IntoBoxedView for Twhere
T: View,
source§fn into_boxed_view(self) -> Box<dyn View>
fn into_boxed_view(self) -> Box<dyn View>
Box<View>.source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().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>
fn fixed_size<S>(self, size: S) -> ResizedView<Self>
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>
fn max_size<S>(self, size: S) -> ResizedView<Self>
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>
fn min_size<S>(self, size: S) -> ResizedView<Self>
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.