pub struct Tabbed<'a> { /* private fields */ }Expand description
A tabbed widget.
This widget draws the tabs and handles events.
Use TabbedState::selected and TabbedState::widget_area to render the actual content of the tab.
Implementations§
Source§impl<'a> Tabbed<'a>
impl<'a> Tabbed<'a>
pub fn new() -> Self
Sourcepub fn placement(self, placement: TabPlacement) -> Self
pub fn placement(self, placement: TabPlacement) -> Self
Tab placement.
Sourcepub fn tabs(self, tabs: impl IntoIterator<Item = impl Into<Line<'a>>>) -> Self
pub fn tabs(self, tabs: impl IntoIterator<Item = impl Into<Line<'a>>>) -> Self
Tab-text.
Sourcepub fn closeable(self, closeable: bool) -> Self
pub fn closeable(self, closeable: bool) -> Self
Closeable tabs?
Renders a close symbol and reacts with TabbedOutcome::Close.
Sourcepub fn styles(self, styles: TabbedStyle) -> Self
pub fn styles(self, styles: TabbedStyle) -> Self
Set combined styles.
Sourcepub fn hover_style(self, style: Style) -> Self
pub fn hover_style(self, style: Style) -> Self
Style for hover.
Sourcepub fn select_style(self, style: Style) -> Self
pub fn select_style(self, style: Style) -> Self
Style for the selected tab.
Sourcepub fn focus_style(self, style: Style) -> Self
pub fn focus_style(self, style: Style) -> Self
Style for a focused tab.
Sourcepub fn into_widgets(self) -> (LayoutWidget<'a>, TabbedWidget<'a>)
pub fn into_widgets(self) -> (LayoutWidget<'a>, TabbedWidget<'a>)
Constructs the widgets for rendering.
Returns the LayoutWidget that must run first. It doesn’t actually render anything, it just calculates the layout for the tab regions.
Use TabbedState::widget_area to render the selected tab.
The TabbedWidget actually renders the tabs. Render it after you finished with the content.
Trait Implementations§
Source§impl StatefulWidget for &Tabbed<'_>
impl StatefulWidget for &Tabbed<'_>
Source§impl StatefulWidget for Tabbed<'_>
impl StatefulWidget for Tabbed<'_>
Auto Trait Implementations§
impl<'a> Freeze for Tabbed<'a>
impl<'a> RefUnwindSafe for Tabbed<'a>
impl<'a> Send for Tabbed<'a>
impl<'a> Sync for Tabbed<'a>
impl<'a> Unpin for Tabbed<'a>
impl<'a> UnwindSafe for Tabbed<'a>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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