cosmic::widget::button

Trait Catalog

source
pub trait Catalog {
    type Class: Default;

    // Required methods
    fn active(
        &self,
        focused: bool,
        selected: bool,
        style: &Self::Class,
    ) -> Style;
    fn disabled(&self, style: &Self::Class) -> Style;
    fn hovered(
        &self,
        focused: bool,
        selected: bool,
        style: &Self::Class,
    ) -> Style;
    fn pressed(
        &self,
        focused: bool,
        selected: bool,
        style: &Self::Class,
    ) -> Style;
    fn selection_background(&self) -> Background;

    // Provided method
    fn drop_target(&self, style: &Self::Class) -> Style { ... }
}
Expand description

A set of rules that dictate the style of a button.

Required Associated Types§

source

type Class: Default

The supported style of the [StyleSheet].

Required Methods§

source

fn active(&self, focused: bool, selected: bool, style: &Self::Class) -> Style

Produces the active [Appearance] of a button.

source

fn disabled(&self, style: &Self::Class) -> Style

Produces the disabled [Appearance] of a button.

source

fn hovered(&self, focused: bool, selected: bool, style: &Self::Class) -> Style

Produces the hovered [Appearance] of a button.

source

fn pressed(&self, focused: bool, selected: bool, style: &Self::Class) -> Style

Produces the pressed [Appearance] of a button.

source

fn selection_background(&self) -> Background

Background color of the selection indicator

Provided Methods§

source

fn drop_target(&self, style: &Self::Class) -> Style

[Appearance] when the button is the target of a DND operation.

Implementors§