pub struct FloatingActionButton { /* private fields */ }Expand description
A floating action button. Content is an icon widget, a text label, or the default “+” glyph.
Implementations§
Source§impl FloatingActionButton
impl FloatingActionButton
pub fn new() -> Self
Sourcepub fn icon(self, w: impl Widget + 'static) -> Self
pub fn icon(self, w: impl Widget + 'static) -> Self
Icon widget centered in the button (usually super::Icon).
Sourcepub fn label(self, s: impl Into<String>) -> Self
pub fn label(self, s: impl Into<String>) -> Self
Text content instead of an icon (e.g. “+” or a short label).
pub fn size(self, s: f32) -> Self
Sourcepub fn background(self, c: Color) -> Self
pub fn background(self, c: Color) -> Self
Fill — defaults to the theme’s primary.
pub fn elevation(self, e: f32) -> Self
pub fn disabled(self, d: bool) -> Self
pub fn on_press(self, f: impl Fn() + Send + Sync + 'static) -> Self
Trait Implementations§
Source§impl Default for FloatingActionButton
impl Default for FloatingActionButton
Source§impl Widget for FloatingActionButton
impl Widget for FloatingActionButton
Source§fn layout(&self, _ctx: &LayoutCtx<'_>) -> Size
fn layout(&self, _ctx: &LayoutCtx<'_>) -> Size
Measure under
ctx.constraints and return a size within them. Read moreSource§fn children(&self) -> Children<'_>
fn children(&self) -> Children<'_>
Declare this widget’s children. Drives every default below.
Source§fn flex_factor(&self) -> f32
fn flex_factor(&self) -> f32
Flex weight inside Row/Column. Wrappers are transparent by default.
Auto Trait Implementations§
impl !RefUnwindSafe for FloatingActionButton
impl !UnwindSafe for FloatingActionButton
impl Freeze for FloatingActionButton
impl Send for FloatingActionButton
impl Sync for FloatingActionButton
impl Unpin for FloatingActionButton
impl UnsafeUnpin for FloatingActionButton
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<W> FocusApi for W
impl<W> FocusApi for W
Source§fn focus_node(self, node: FocusNode) -> WithFocus<Self>
fn focus_node(self, node: FocusNode) -> WithFocus<Self>
Attach a focus node. This enables focus-ring rendering and explicit
neighbor wiring.