pub struct ExtendedFab { /* private fields */ }Expand description
An elevated action with a label or custom content and an optional icon. All presentations share one action, accessible name, and focus handle.
Implementations§
Source§impl ExtendedFab
impl ExtendedFab
Sourcepub fn new(
id: impl Into<ElementId>,
label: impl Into<SharedString>,
icon: impl IntoElement,
) -> ExtendedFab
pub fn new( id: impl Into<ElementId>, label: impl Into<SharedString>, icon: impl IntoElement, ) -> ExtendedFab
Creates an action with a leading icon and a label.
Sourcepub fn text(
id: impl Into<ElementId>,
label: impl Into<SharedString>,
) -> ExtendedFab
pub fn text( id: impl Into<ElementId>, label: impl Into<SharedString>, ) -> ExtendedFab
Creates a text-only action. The label also supplies its accessible name.
pub fn size(self, size: FabSize) -> ExtendedFab
pub fn color(self, color: FabColor) -> ExtendedFab
Sourcepub fn disabled(self, disabled: bool) -> ExtendedFab
pub fn disabled(self, disabled: bool) -> ExtendedFab
Desktop compatibility extension. Material recommends hiding a FAB when its primary action is unavailable instead of disabling it.
pub fn track_focus(self, focus: &FocusHandle) -> ExtendedFab
pub fn on_activate( self, handler: impl Fn(&mut Window, &mut App) + 'static, ) -> ExtendedFab
Sourcepub fn shape(self, shape: CornerShape) -> ExtendedFab
pub fn shape(self, shape: CornerShape) -> ExtendedFab
Overrides the container shape for all interaction states.
Sourcepub fn colors(self, colors: ButtonColors) -> ExtendedFab
pub fn colors(self, colors: ButtonColors) -> ExtendedFab
Sets the enabled and disabled container and content colors.
Sourcepub fn elevations(self, elevations: ButtonElevations) -> ExtendedFab
pub fn elevations(self, elevations: ButtonElevations) -> ExtendedFab
Overrides the elevation for each interaction state.
Sourcepub fn interaction_source(
self,
source: &Entity<InteractionSource>,
) -> ExtendedFab
pub fn interaction_source( self, source: &Entity<InteractionSource>, ) -> ExtendedFab
Reports interaction state through a caller-owned source.
Sourcepub fn visible(self, visible: bool) -> ExtendedFab
pub fn visible(self, visible: bool) -> ExtendedFab
Applies the caller’s visibility state. Use a stable ID across updates.
Sourcepub fn visibility_animation(
self,
animation: FabVisibilityAnimation,
) -> ExtendedFab
pub fn visibility_animation( self, animation: FabVisibilityAnimation, ) -> ExtendedFab
Sets the pivot, hidden scale, and independent scale and alpha motions.
Sourcepub fn content(self, content: impl IntoElement) -> ExtendedFab
pub fn content(self, content: impl IntoElement) -> ExtendedFab
Replaces the rendered label with decorative content. The constructor’s accessible name and optional icon still belong to the action.
Sourcepub fn expanded(self, expanded: bool) -> ExtendedFab
pub fn expanded(self, expanded: bool) -> ExtendedFab
Applies the caller’s expansion state. An icon-bearing action collapses to a square. Iconless actions retain their content in both states.
Trait Implementations§
Source§impl IntoElement for ExtendedFab
impl IntoElement for ExtendedFab
Source§type Element = ViewElement<ExtendedFab>
type Element = ViewElement<ExtendedFab>
Source§fn into_element(self) -> <ExtendedFab as IntoElement>::Element
fn into_element(self) -> <ExtendedFab as IntoElement>::Element
Element.Source§fn into_any_element(self) -> AnyElement
fn into_any_element(self) -> AnyElement
AnyElement.Source§impl RenderOnce for ExtendedFab
impl RenderOnce for ExtendedFab
Source§fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement
fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement
Render::render() method
which takes a mutable reference.Auto Trait Implementations§
impl !RefUnwindSafe for ExtendedFab
impl !Send for ExtendedFab
impl !Sync for ExtendedFab
impl !UnwindSafe for ExtendedFab
impl Forget for ExtendedFab
impl Freeze for ExtendedFab
impl Move for ExtendedFab
impl Unpin for ExtendedFab
impl UnsafeUnpin for ExtendedFab
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,
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,
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>
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
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,
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,
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,
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> ⓘ
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> ⓘ
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
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
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
Tooltip.Menu.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>) -> Self::Element
fn test_text(self, text: impl Into<SharedString>) -> Self::Element
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>) -> Self::Element
fn test_alt_text(self, text: impl Into<SharedString>) -> Self::Element
Self::test_text for an image’s alternative text, which
stands in for what the element draws.