pub struct Tabs { /* private fields */ }Expand description
A fixed Material tab row by default. Enable scrolling for long tab lists.
Implementations§
Source§impl Tabs
impl Tabs
Sourcepub fn new(items: NavigationItems) -> Self
pub fn new(items: NavigationItems) -> Self
Creates a fixed primary Material tab row from the given controlled NavigationItems.
Sourcepub fn variant(self, variant: TabVariant) -> Self
pub fn variant(self, variant: TabVariant) -> Self
Sets whether tabs use TabVariant::Primary (default) or TabVariant::Secondary styling.
Sourcepub fn scrollable(self, scrollable: bool) -> Self
pub fn scrollable(self, scrollable: bool) -> Self
Enables or disables horizontal scrolling for long tab lists (default false).
Sourcepub fn scroll_handle(self, handle: &ScrollHandle) -> Self
pub fn scroll_handle(self, handle: &ScrollHandle) -> Self
Uses a caller-owned handle when horizontal scrolling is enabled.
Sourcepub fn edge_padding(self, padding: Pixels) -> Self
pub fn edge_padding(self, padding: Pixels) -> Self
Sets the logical start and end padding for scrolling tabs.
Sourcepub fn min_tab_width(self, width: Pixels) -> Self
pub fn min_tab_width(self, width: Pixels) -> Self
Sets the minimum width of a scrolling tab.
Sourcepub fn colors(self, colors: TabsColors) -> Self
pub fn colors(self, colors: TabsColors) -> Self
Overrides container, default content, and divider colors for the tab row.
Sourcepub fn divider(self, divider: impl IntoElement) -> Self
pub fn divider(self, divider: impl IntoElement) -> Self
Replaces the row’s decorative bottom divider.
Sourcepub fn indicator_style(self, style: TabIndicatorStyle) -> Self
pub fn indicator_style(self, style: TabIndicatorStyle) -> Self
Overrides the active indicator’s width, height, color, shape, and motion.
Sourcepub fn indicator_content<E: IntoElement>(
self,
content: impl Fn(TabIndicatorLayout) -> E + 'static,
) -> Self
pub fn indicator_content<E: IntoElement>( self, content: impl Fn(TabIndicatorLayout) -> E + 'static, ) -> Self
Builds a decorative indicator constrained to the resolved indicator bounds.
Trait Implementations§
Source§impl IntoElement for Tabs
impl IntoElement for Tabs
Source§type Element = ViewElement<Tabs>
type Element = ViewElement<Tabs>
The specific type of element into which the implementing type is converted.
Useful for converting other types into elements automatically, like Strings
Source§fn into_element(self) -> Self::Element
fn into_element(self) -> Self::Element
Convert self into a type that implements
Element.Source§fn into_any_element(self) -> AnyElement
fn into_any_element(self) -> AnyElement
Convert self into a dynamically-typed
AnyElement.Source§impl RenderOnce for Tabs
impl RenderOnce for Tabs
Source§fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement
fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement
Render this component into an element tree. Note that this method
takes ownership of self, as compared to
Render::render() method
which takes a mutable reference.Auto Trait Implementations§
impl !RefUnwindSafe for Tabs
impl !Send for Tabs
impl !Sync for Tabs
impl !UnwindSafe for Tabs
impl Forget for Tabs
impl Freeze for Tabswhere
NonZero<u32>: Freeze,
&'static str: Freeze,
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
*const ArcInner<Path> is !null: Freeze,
PhantomData<ArcInner<Path>>: Freeze,
*const str is !null: Freeze,
PhantomData<&'static str>: Freeze,
*const ArcInner<ElementId> is !null: Freeze,
PhantomData<ArcInner<ElementId>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<NavigationItem>: Freeze,
*const RcInner<dyn Fn(&SharedString, &mut Window, &mut App)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&SharedString, &mut Window, &mut App)>>: Freeze,
*const (): Freeze,
*const ArcInner<RwLock<RawRwLock, EntityRefCounts>> is !null: Freeze,
PhantomData<fn(RowState) -> RowState>: Freeze,
PhantomData<(SharedString, AnyElement)>: Freeze,
*const RcInner<RefCell<ScrollHandleState>> is !null: Freeze,
PhantomData<RcInner<RefCell<ScrollHandleState>>>: Freeze,
*mut dyn ElementObject: Freeze,
*const RcInner<Cell<bool>> is !null: Freeze,
PhantomData<RcInner<Cell<bool>>>: Freeze,
*const dyn Fn(TabIndicatorLayout) -> AnyElement is !null: Freeze,
PhantomData<dyn Fn(TabIndicatorLayout) -> AnyElement>: Freeze,
impl Move for Tabs
impl Unpin for Tabswhere
NonZero<u32>: Unpin,
&'static str: Unpin,
Arc<str>: Unpin,
Arc<Path>: Unpin,
*const str is !null: Unpin,
Arc<ElementId>: Unpin,
*const u8 is !null: Unpin,
Arc<[u8]>: Unpin,
*mut dyn ElementObject: Unpin,
Rc<Cell<bool>>: Unpin,
*const (): Unpin,
*const ArcInner<RwLock<RawRwLock, EntityRefCounts>> is !null: Unpin,
Rc<dyn Fn(&SharedString, &mut Window, &mut App)>: Unpin,
Rc<RefCell<ScrollHandleState>>: Unpin,
Box<dyn Fn(TabIndicatorLayout) -> AnyElement>: Unpin,
impl UnsafeUnpin for Tabswhere
NonZeroU32Inner: UnsafeUnpin,
&'static str: UnsafeUnpin,
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
*const ArcInner<Path> is !null: UnsafeUnpin,
PhantomData<ArcInner<Path>>: UnsafeUnpin,
*const str is !null: UnsafeUnpin,
PhantomData<&'static str>: UnsafeUnpin,
*const ArcInner<ElementId> is !null: UnsafeUnpin,
PhantomData<ArcInner<ElementId>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<NavigationItem>: UnsafeUnpin,
*const RcInner<dyn Fn(&SharedString, &mut Window, &mut App)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&SharedString, &mut Window, &mut App)>>: UnsafeUnpin,
*const (): UnsafeUnpin,
*const ArcInner<RwLock<RawRwLock, EntityRefCounts>> is !null: UnsafeUnpin,
PhantomData<fn(RowState) -> RowState>: UnsafeUnpin,
PhantomData<(SharedString, AnyElement)>: UnsafeUnpin,
*const RcInner<RefCell<ScrollHandleState>> is !null: UnsafeUnpin,
PhantomData<RcInner<RefCell<ScrollHandleState>>>: UnsafeUnpin,
*mut dyn ElementObject: UnsafeUnpin,
*const RcInner<Cell<bool>> is !null: UnsafeUnpin,
PhantomData<RcInner<Cell<bool>>>: UnsafeUnpin,
*const dyn Fn(TabIndicatorLayout) -> AnyElement is !null: UnsafeUnpin,
PhantomData<dyn Fn(TabIndicatorLayout) -> AnyElement>: UnsafeUnpin,
Blanket Implementations§
Source§impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
Source§fn with_animation(
self,
id: impl Into<ElementId>,
animation: Animation,
animator: impl Fn(Self, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
fn with_animation(
self,
id: impl Into<ElementId>,
animation: Animation,
animator: impl Fn(Self, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
Render this component or element with an animation
Source§fn with_animations(
self,
id: impl Into<ElementId>,
animations: Vec<Animation>,
animator: impl Fn(Self, usize, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
fn with_animations(
self,
id: impl Into<ElementId>,
animations: Vec<Animation>,
animator: impl Fn(Self, usize, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
Render this component or element with a chain of animations
Source§fn with_spring<T>(
self,
id: impl Into<ElementId>,
animation: SpringAnimation<T>,
animator: impl FnOnce(Self, <T as SpringTarget>::Output) -> Self + 'static,
) -> SpringAnimationElement<Self>
fn with_spring<T>( self, id: impl Into<ElementId>, animation: SpringAnimation<T>, animator: impl FnOnce(Self, <T as SpringTarget>::Output) -> Self + 'static, ) -> SpringAnimationElement<Self>
Renders this component or element at the value produced by a spring. Read more
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FluentBuilder for Twhere
T: IntoElement,
impl<T> FluentBuilder for Twhere
T: IntoElement,
Source§fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
Imperatively modify self with the given closure.
Source§fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere
Self: Sized,
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere
Self: Sized,
Conditionally modify self with the given closure.
Source§fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Selfwhere
Self: Sized,
fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Selfwhere
Self: Sized,
Conditionally modify self with the given closure.
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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 moreSource§impl<T> MaterialElementExt for Twhere
T: IntoElement,
impl<T> MaterialElementExt for Twhere
T: IntoElement,
Source§fn badge_label(self, text: impl Into<SharedString>) -> Badge
fn badge_label(self, text: impl Into<SharedString>) -> Badge
Anchors a text
Badge to this element’s upper trailing edge.Source§fn badge_count(self, count: usize, maximum: usize) -> Badge
fn badge_count(self, count: usize, maximum: usize) -> Badge
Anchors a capped numeric
Badge to this element’s upper trailing edge.Source§fn tooltip(
self,
id: impl Into<ElementId>,
text: impl Into<SharedString>,
) -> Tooltip
fn tooltip( self, id: impl Into<ElementId>, text: impl Into<SharedString>, ) -> Tooltip
Wraps this element as the trigger of a plain
Tooltip.Wraps this element as the trigger of a secondary-click context
Menu.Wraps this element as the trigger of a secondary-click context
Menu
whose items are built lazily only while the menu is open.Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<E> TestTextExt for Ewhere
E: IntoElement,
impl<E> TestTextExt for Ewhere
E: IntoElement,
Source§fn test_text(self, text: impl Into<SharedString>) -> ObservedText<Self::Element>
fn test_text(self, text: impl Into<SharedString>) -> ObservedText<Self::Element>
With
test-support, records text each time the element paints.
Otherwise returns the element it builds.Source§fn test_alt_text(
self,
text: impl Into<SharedString>,
) -> ObservedText<Self::Element>
fn test_alt_text( self, text: impl Into<SharedString>, ) -> ObservedText<Self::Element>
Like
Self::test_text for an image’s alternative text, which
stands in for what the element draws.