cosmic::widget

Type Alias IconButton

source
pub type IconButton<'a, Message> = Builder<'a, Message, Icon>;

Aliased Type§

struct IconButton<'a, Message> { /* private fields */ }

Implementations§

source§

impl<'a, Message> Button<'a, Message>

source

pub fn new(icon: Icon) -> Self

source

pub fn extra_small(self) -> Self

Applies the Extra Small button size preset.

source

pub fn medium(self) -> Self

Applies the Medium button size preset.

source

pub fn large(self) -> Self

Applies the Large button size preset.

source

pub fn extra_large(self) -> Self

Applies the Extra Large button size preset.

source

pub fn selected(self, selected: bool) -> Self

source

pub fn vertical(self, vertical: bool) -> Self

source§

impl<'a, Message, Variant> Builder<'a, Message, Variant>

source

pub fn on_press_maybe(self, on_press: Option<Message>) -> Self

Set the value of [on_press] as either Some or None.

source§

impl<'a, Message, Variant> Builder<'a, Message, Variant>

source

pub fn id(self, value: Id) -> Self

Sets the Id of the button.

source

pub fn label(self, value: impl Into<Cow<'a, str>>) -> Self

The label to display within the button.

source

pub fn tooltip(self, value: impl Into<Cow<'a, str>>) -> Self

source

pub fn on_press(self, value: Message) -> Self

Sets the message that will be produced when the button is pressed.

If None, the button will be disabled.

source

pub fn width(self, value: impl Into<Length>) -> Self

Sets the preferred width of the button.

source

pub fn height(self, value: impl Into<Length>) -> Self

Sets the preferred height of the button.

source

pub fn padding(self, value: impl Into<Padding>) -> Self

Sets the preferred padding of the button.

source

pub fn spacing(self, value: u16) -> Self

Sets the preferred spacing between elements in the button.

source

pub fn icon_size(self, value: u16) -> Self

Sets the preferred size of icons.

source

pub fn line_height(self, value: u16) -> Self

Sets the prefered font line height.

source

pub fn font_size(self, value: u16) -> Self

Sets the preferred font size.

source

pub fn font_weight(self, value: Weight) -> Self

Sets the preferred font weight.

source

pub fn class(self, value: ButtonClass) -> Self

The preferred style of the button.