pub struct ButtonScope { /* private fields */ }Expand description
A Button and its builder.
Implementations§
Source§impl ButtonScope
impl ButtonScope
pub fn enabled(self, enabled: bool) -> Self
pub fn variant(self, variant: ButtonVariant) -> Self
Sourcepub fn kind(self, kind: ButtonKind) -> Self
pub fn kind(self, kind: ButtonKind) -> Self
What the button is, apart from how loud it is: ButtonKind::ActionKey is one key of
a dense grid, drawn in the design system’s own calculator-key shape.
Sourcepub fn max_lines(self, lines: u32) -> Self
pub fn max_lines(self, lines: u32) -> Self
How many lines the label may take. A label is one line unless this says more, so a Korean label is never broken between syllables by a squeezed parent.
Sourcepub fn overflow(self, overflow: TextOverflow) -> Self
pub fn overflow(self, overflow: TextOverflow) -> Self
What happens to a label longer than its lines.
Sourcepub fn color(self, paint: Paint) -> Self
pub fn color(self, paint: Paint) -> Self
The label’s colour, for the rare button whose meaning is not its variant’s.
Sourcepub fn color_if(self, paint: Option<Paint>) -> Self
pub fn color_if(self, paint: Option<Paint>) -> Self
The same, when there may be no colour of its own.
pub fn on_click(self, handler: impl FnMut() + 'static) -> Self
Trait Implementations§
Source§impl Drop for ButtonScope
impl Drop for ButtonScope
Auto Trait Implementations§
impl !RefUnwindSafe for ButtonScope
impl !Send for ButtonScope
impl !Sync for ButtonScope
impl !UnwindSafe for ButtonScope
impl Freeze for ButtonScope
impl Unpin for ButtonScope
impl UnsafeUnpin for ButtonScope
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