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§
Required Methods§
sourcefn active(&self, focused: bool, selected: bool, style: &Self::Class) -> Style
fn active(&self, focused: bool, selected: bool, style: &Self::Class) -> Style
Produces the active [Appearance
] of a button.
sourcefn disabled(&self, style: &Self::Class) -> Style
fn disabled(&self, style: &Self::Class) -> Style
Produces the disabled [Appearance
] of a button.
sourcefn hovered(&self, focused: bool, selected: bool, style: &Self::Class) -> Style
fn hovered(&self, focused: bool, selected: bool, style: &Self::Class) -> Style
Produces the hovered [Appearance
] of a button.
sourcefn pressed(&self, focused: bool, selected: bool, style: &Self::Class) -> Style
fn pressed(&self, focused: bool, selected: bool, style: &Self::Class) -> Style
Produces the pressed [Appearance
] of a button.
sourcefn selection_background(&self) -> Background
fn selection_background(&self) -> Background
Background color of the selection indicator
Provided Methods§
sourcefn drop_target(&self, style: &Self::Class) -> Style
fn drop_target(&self, style: &Self::Class) -> Style
[Appearance
] when the button is the target of a DND operation.