pub struct FabView<State: 'static> { /* private fields */ }Expand description
A declarative M3E FAB. See the module docs.
Implementations§
Source§impl<State: 'static> FabView<State>
impl<State: 'static> FabView<State>
Sourcepub fn size(self, size: FabSize) -> Self
pub fn size(self, size: FabSize) -> Self
Set the container size tier (fab only — ignored on an
extended_fab, whose height is always EXTENDED_HEIGHT).
Sourcepub fn icon(self, icon: impl View<State>) -> Self
pub fn icon(self, icon: impl View<State>) -> Self
Attach a leading icon (usable on extended_fab; fab already
requires one at construction).
Sourcepub fn label(self, label: impl Into<String>) -> Self
pub fn label(self, label: impl Into<String>) -> Self
Attach an accessible label (fab’s content description). A no-op
override on an extended_fab, whose visible label is already the
accessible name.
Sourcepub fn extended(self, extended: bool) -> Self
pub fn extended(self, extended: bool) -> Self
Whether the label is shown (only meaningful on an extended_fab —
a no-op on a plain fab, which has no label to show). Defaults to
true. Setting false animates the label away, collapsing the pill
toward an icon-only shape — see the module docs’ Extended
FAB section.
Sourcepub fn corner_radius(self, radius: Option<f64>) -> Self
pub fn corner_radius(self, radius: Option<f64>) -> Self
Override the corner radius (fab only — a no-op on
extended_fab; see the module docs’ Corner-radius
override seam section). None (the default) resolves the
size-derived themed radius, easing toward a changed target with
MaterialMotion::SHORT_4; Some(r) pins the radius to r
immediately every frame, with no internal animation.
Trait Implementations§
Source§impl<State: 'static> View<State> for FabView<State>
impl<State: 'static> View<State> for FabView<State>
Source§fn build(&self, ctx: &mut BuildCtx<'_>) -> FabWidget
fn build(&self, ctx: &mut BuildCtx<'_>) -> FabWidget
Source§fn rebuild(
&self,
prev: &Self,
element: &mut FabWidget,
ctx: &mut BuildCtx<'_>,
) -> ChangeFlags
fn rebuild( &self, prev: &Self, element: &mut FabWidget, ctx: &mut BuildCtx<'_>, ) -> ChangeFlags
prev (the previous view of the same type) against the live
element, mutating it in place and reporting what changed.Auto Trait Implementations§
impl<State> !RefUnwindSafe for FabView<State>
impl<State> !Send for FabView<State>
impl<State> !Sync for FabView<State>
impl<State> !UnwindSafe for FabView<State>
impl<State> Freeze for FabView<State>
impl<State> Unpin for FabView<State>
impl<State> UnsafeUnpin for FabView<State>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Source§impl<State, V> ViewSeq<State, One> for Vwhere
State: 'static,
V: View<State>,
impl<State, V> ViewSeq<State, One> for Vwhere
State: 'static,
V: View<State>,
Source§fn extend_views(self, out: &mut Vec<AnyView<State>>)
fn extend_views(self, out: &mut Vec<AnyView<State>>)
out — erasing each
with AnyView::new (a no-op for an element already an AnyView).