pub struct Tabs { /* private fields */ }Expand description
Tabs widget for tabbed navigation.
Implementations§
Source§impl Tabs
impl Tabs
Sourcepub fn tabs(self, tabs: impl IntoIterator<Item = Tab>) -> Self
pub fn tabs(self, tabs: impl IntoIterator<Item = Tab>) -> Self
Add multiple tabs.
Sourcepub const fn orientation(self, orientation: TabOrientation) -> Self
pub const fn orientation(self, orientation: TabOrientation) -> Self
Set tab orientation.
Sourcepub fn min_tab_width(self, width: f32) -> Self
pub fn min_tab_width(self, width: f32) -> Self
Set minimum tab width.
Sourcepub const fn inactive_color(self, color: Color) -> Self
pub const fn inactive_color(self, color: Color) -> Self
Set inactive tab text color.
Sourcepub const fn active_color(self, color: Color) -> Self
pub const fn active_color(self, color: Color) -> Self
Set active tab text color.
Sourcepub const fn show_border(self, show: bool) -> Self
pub const fn show_border(self, show: bool) -> Self
Set whether to show border.
Sourcepub fn accessible_name(self, name: impl Into<String>) -> Self
pub fn accessible_name(self, name: impl Into<String>) -> Self
Set the accessible name.
Sourcepub const fn get_active(&self) -> usize
pub const fn get_active(&self) -> usize
Get active tab index.
Sourcepub fn get_active_tab(&self) -> Option<&Tab>
pub fn get_active_tab(&self) -> Option<&Tab>
Get active tab.
Sourcepub fn get_active_id(&self) -> Option<&str>
pub fn get_active_id(&self) -> Option<&str>
Get active tab ID.
Sourcepub fn set_active(&mut self, index: usize)
pub fn set_active(&mut self, index: usize)
Set active tab by index (mutable).
Sourcepub fn set_active_id(&mut self, id: &str)
pub fn set_active_id(&mut self, id: &str)
Set active tab by ID (mutable).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Tabs
impl<'de> Deserialize<'de> for Tabs
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Widget for Tabs
impl Widget for Tabs
Source§fn measure(&self, constraints: Constraints) -> Size
fn measure(&self, constraints: Constraints) -> Size
Compute intrinsic size constraints. Read more
Source§fn layout(&mut self, bounds: Rect) -> LayoutResult
fn layout(&mut self, bounds: Rect) -> LayoutResult
Position children within allocated bounds. Read more
Source§fn event(&mut self, event: &Event) -> Option<Box<dyn Any + Send>>
fn event(&mut self, event: &Event) -> Option<Box<dyn Any + Send>>
Handle input events. Read more
Source§fn children_mut(&mut self) -> &mut [Box<dyn Widget>]
fn children_mut(&mut self) -> &mut [Box<dyn Widget>]
Get mutable child widgets.
Source§fn is_interactive(&self) -> bool
fn is_interactive(&self) -> bool
Check if this widget is interactive (can receive focus/events).
Source§fn is_focusable(&self) -> bool
fn is_focusable(&self) -> bool
Check if this widget can receive keyboard focus.
Source§fn accessible_name(&self) -> Option<&str>
fn accessible_name(&self) -> Option<&str>
Get the accessible name for screen readers.
Source§fn accessible_role(&self) -> AccessibleRole
fn accessible_role(&self) -> AccessibleRole
Get the accessible role.
Auto Trait Implementations§
impl Freeze for Tabs
impl RefUnwindSafe for Tabs
impl Send for Tabs
impl Sync for Tabs
impl Unpin for Tabs
impl UnwindSafe for Tabs
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