cosmic::widget

Type Alias LinkButton

source
pub type LinkButton<'a, Message> = Builder<'a, Message, Hyperlink>;

Aliased Type§

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

Implementations§

source§

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

source

pub fn new(label: impl Into<Cow<'a, str>> + 'static, link: Hyperlink) -> Self

source

pub const fn trailing_icon(self, set: 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.