pub struct Button { /* private fields */ }
Implementations§
source§impl Button
impl Button
pub fn new(label: impl Into<SharedString>) -> Self
pub fn ghost(label: impl Into<SharedString>) -> Self
pub fn variant(self, variant: ButtonVariant) -> Self
pub fn icon(self, icon: Icon) -> Self
pub fn icon_position(self, icon_position: IconPosition) -> Self
pub fn width(self, width: Option<DefiniteLength>) -> Self
pub fn on_click( self, handler: impl Fn(&MouseDownEvent, &mut WindowContext<'_>) + 'static ) -> Self
pub fn disabled(self, disabled: bool) -> Self
pub fn color(self, color: Option<Color>) -> Self
pub fn label_color(&self, color: Option<Color>) -> Color
Trait Implementations§
source§impl From<Button> for ButtonOrIconButton
impl From<Button> for ButtonOrIconButton
source§impl RenderOnce for Button
impl RenderOnce for Button
type Element = CompositeElement<Button>
fn element_id(&self) -> Option<ElementId>
fn render_once(self) -> Self::Element
fn render_into_any(self) -> AnyElement
fn draw<T, R>( self, origin: Point<Pixels>, available_space: Size<T>, cx: &mut WindowContext<'_>, f: impl FnOnce(&mut <Self::Element as Element>::State, &mut WindowContext<'_>) -> R ) -> Rwhere T: Clone + Default + Debug + Into<AvailableSpace>,
fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere Self: Sized, U: RenderOnce,
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere Self: Sized,
fn when_some<T>( self, option: Option<T>, then: impl FnOnce(Self, T) -> Self ) -> Selfwhere Self: Sized,
Auto Trait Implementations§
impl !RefUnwindSafe for Button
impl !Send for Button
impl !Sync for Button
impl Unpin for Button
impl !UnwindSafe for Button
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