pub struct TabBar<'a> { /* private fields */ }Expand description
A horizontal tab bar. The active tab is indicated by a sky-coloured underline and an inactive tab lights up on hover.
let mut selected = 0usize;
ui.add(TabBar::new(&mut selected, ["Overview", "Settings", "Activity"]));Implementations§
Source§impl<'a> TabBar<'a>
impl<'a> TabBar<'a>
Sourcepub fn new<I, S>(selected: &'a mut usize, tabs: I) -> Self
pub fn new<I, S>(selected: &'a mut usize, tabs: I) -> Self
Build a tab bar. Accepts any iterator of items that convert into
WidgetText, so both static arrays and dynamic collections work:
let mut selected = 0usize;
ui.add(TabBar::new(&mut selected, ["Overview", "Settings"]));
let dynamic: Vec<String> = vec!["A".into(), "B".into()];
ui.add(TabBar::new(&mut selected, dynamic));Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for TabBar<'a>
impl<'a> RefUnwindSafe for TabBar<'a>
impl<'a> Send for TabBar<'a>
impl<'a> Sync for TabBar<'a>
impl<'a> Unpin for TabBar<'a>
impl<'a> UnsafeUnpin for TabBar<'a>
impl<'a> !UnwindSafe for TabBar<'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