pub enum Content<'a> {
Label(Fragment<'a>),
IconLabel {
icon: Fragment<'a>,
label: Fragment<'a>,
layout: IconLabelLayout,
},
}Expand description
The content shown inside a tab.
Variants§
Implementations§
Source§impl<'a> Content<'a>
impl<'a> Content<'a>
Sourcepub fn label(label: impl IntoFragment<'a>) -> Self
pub fn label(label: impl IntoFragment<'a>) -> Self
Creates label-only tab content.
Examples found in repository?
examples/showcase/pages/navigation.rs (line 61)
35fn tabs(state: &Showcase) -> material::Element<'_, Message> {
36 page::component_stack([
37 material::widget::tabs::animated_tabs(
38 material::widget::tabs::Variant::Primary,
39 &state.primary_tab_state,
40 [
41 (
42 material::widget::tabs::Content::stacked_icon_label("input", "Inputs"),
43 Message::PrimaryTabSelected(TabChoice::Inputs),
44 ),
45 (
46 material::widget::tabs::Content::stacked_icon_label("tune", "Controls"),
47 Message::PrimaryTabSelected(TabChoice::Controls),
48 ),
49 (
50 material::widget::tabs::Content::stacked_icon_label("info", "Feedback"),
51 Message::PrimaryTabSelected(TabChoice::Feedback),
52 ),
53 ],
54 )
55 .into(),
56 material::widget::tabs::animated_tabs(
57 material::widget::tabs::Variant::Secondary,
58 &state.secondary_tab_state,
59 [
60 (
61 material::widget::tabs::Content::label("Overview"),
62 Message::SecondaryTabSelected(TabChoice::Inputs),
63 ),
64 (
65 material::widget::tabs::Content::label("Details"),
66 Message::SecondaryTabSelected(TabChoice::Controls),
67 ),
68 (
69 material::widget::tabs::Content::label("History"),
70 Message::SecondaryTabSelected(TabChoice::Feedback),
71 ),
72 ],
73 )
74 .into(),
75 ])
76 .into()
77}Sourcepub fn stacked_icon_label(
icon: impl IntoFragment<'a>,
label: impl IntoFragment<'a>,
) -> Self
pub fn stacked_icon_label( icon: impl IntoFragment<'a>, label: impl IntoFragment<'a>, ) -> Self
Creates stacked icon-label tab content.
Examples found in repository?
examples/showcase/pages/navigation.rs (line 42)
35fn tabs(state: &Showcase) -> material::Element<'_, Message> {
36 page::component_stack([
37 material::widget::tabs::animated_tabs(
38 material::widget::tabs::Variant::Primary,
39 &state.primary_tab_state,
40 [
41 (
42 material::widget::tabs::Content::stacked_icon_label("input", "Inputs"),
43 Message::PrimaryTabSelected(TabChoice::Inputs),
44 ),
45 (
46 material::widget::tabs::Content::stacked_icon_label("tune", "Controls"),
47 Message::PrimaryTabSelected(TabChoice::Controls),
48 ),
49 (
50 material::widget::tabs::Content::stacked_icon_label("info", "Feedback"),
51 Message::PrimaryTabSelected(TabChoice::Feedback),
52 ),
53 ],
54 )
55 .into(),
56 material::widget::tabs::animated_tabs(
57 material::widget::tabs::Variant::Secondary,
58 &state.secondary_tab_state,
59 [
60 (
61 material::widget::tabs::Content::label("Overview"),
62 Message::SecondaryTabSelected(TabChoice::Inputs),
63 ),
64 (
65 material::widget::tabs::Content::label("Details"),
66 Message::SecondaryTabSelected(TabChoice::Controls),
67 ),
68 (
69 material::widget::tabs::Content::label("History"),
70 Message::SecondaryTabSelected(TabChoice::Feedback),
71 ),
72 ],
73 )
74 .into(),
75 ])
76 .into()
77}Sourcepub fn inline_icon_label(
icon: impl IntoFragment<'a>,
label: impl IntoFragment<'a>,
) -> Self
pub fn inline_icon_label( icon: impl IntoFragment<'a>, label: impl IntoFragment<'a>, ) -> Self
Creates inline icon-label tab content.
Trait Implementations§
impl<'a> Eq for Content<'a>
Source§impl<'a> PartialEq for Content<'a>
impl<'a> PartialEq for Content<'a>
impl<'a> StructuralPartialEq for Content<'a>
Auto Trait Implementations§
impl<'a> Freeze for Content<'a>
impl<'a> RefUnwindSafe for Content<'a>
impl<'a> Send for Content<'a>
impl<'a> Sync for Content<'a>
impl<'a> Unpin for Content<'a>
impl<'a> UnsafeUnpin for Content<'a>
impl<'a> UnwindSafe for Content<'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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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<State, Message> IntoBoot<State, Message> for State
impl<State, Message> IntoBoot<State, Message> for State
Source§fn into_boot(self) -> (State, Task<Message>)
fn into_boot(self) -> (State, Task<Message>)
Turns some type into the initial state of some
Application.