pub struct TabView<'a, F = fn(usize, Rect, &mut Buffer)>{ /* private fields */ }Expand description
Tab view widget
A layout component with a tab bar and content area.
Implementations§
Source§impl<'a> TabView<'a, fn(usize, Rect, &mut Buffer)>
impl<'a> TabView<'a, fn(usize, Rect, &mut Buffer)>
Sourcepub fn new(tabs: &'a [Tab<'a>], state: &'a TabViewState) -> Self
pub fn new(tabs: &'a [Tab<'a>], state: &'a TabViewState) -> Self
Create a new tab view with the given tabs and state
Source§impl<'a, F> TabView<'a, F>
impl<'a, F> TabView<'a, F>
Sourcepub fn style(self, style: TabViewStyle) -> Self
pub fn style(self, style: TabViewStyle) -> Self
Set the style for the tab view
Sourcepub fn content<G>(self, renderer: G) -> TabView<'a, G>
pub fn content<G>(self, renderer: G) -> TabView<'a, G>
Set the content renderer
The function receives: (selected_index, content_area, buffer)
Sourcepub fn render_stateful(
self,
area: Rect,
buf: &mut Buffer,
) -> Vec<(Rect, TabViewAction)>
pub fn render_stateful( self, area: Rect, buf: &mut Buffer, ) -> Vec<(Rect, TabViewAction)>
Render the tab view and return click regions
Sourcepub fn render_with_registry(
self,
area: Rect,
buf: &mut Buffer,
registry: &mut ClickRegionRegistry<TabViewAction>,
)
pub fn render_with_registry( self, area: Rect, buf: &mut Buffer, registry: &mut ClickRegionRegistry<TabViewAction>, )
Render and register click regions
Trait Implementations§
Auto Trait Implementations§
impl<'a, F> Freeze for TabView<'a, F>where
F: Freeze,
impl<'a, F> RefUnwindSafe for TabView<'a, F>where
F: RefUnwindSafe,
impl<'a, F> Send for TabView<'a, F>where
F: Send,
impl<'a, F> Sync for TabView<'a, F>where
F: Sync,
impl<'a, F> Unpin for TabView<'a, F>where
F: Unpin,
impl<'a, F> UnwindSafe for TabView<'a, F>where
F: UnwindSafe,
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 more