Struct rat_widget::tabbed::Tabbed
source · pub struct Tabbed<'a> { /* private fields */ }Expand description
A tabbed widget.
This widget draws the tabs and handles events.
Use TabbedState::selected and [TabbedState::inner_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 tab_type(self, tab_type: impl TabType + 'a) -> Self
pub fn tab_type(self, tab_type: impl TabType + 'a) -> Self
Tab-type is a trait that handles layout and rendering for the tabs.
See GluedTabs and [AttachedTabs].
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 is_closeable(&self) -> bool
pub fn is_closeable(&self) -> bool
Closeable tabs?
sourcepub fn styles(self, styles: TabbedStyle) -> Self
pub fn styles(self, styles: TabbedStyle) -> Self
Set combined styles.
sourcepub fn get_tab_style(&self) -> Option<Style>
pub fn get_tab_style(&self) -> Option<Style>
Style for the tab-text.
sourcepub fn select_style(self, style: Style) -> Self
pub fn select_style(self, style: Style) -> Self
Style for the selected tab.
sourcepub fn get_select_style(&self) -> Option<Style>
pub fn get_select_style(&self) -> Option<Style>
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 get_focus_style(&self) -> Option<Style>
pub fn get_focus_style(&self) -> Option<Style>
Style for a focused tab.
Trait Implementations§
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> 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