pub struct Appearance {
pub normal: StateStyle,
pub pressed: StateStyle,
pub hovered: StateStyle,
pub focused: StateStyle,
pub disabled: StateStyle,
pub checked: StateStyle,
pub drag_over: StateStyle,
}Expand description
One StateStyle for each visual state of a Widget.
INDETERMINATE has no style of its own; it is drawn by the generic state overlay.
Fields§
§normal: StateStyleThe look with no state flags set; every other state falls back to it.
pressed: StateStyleThe mouse button is held down on the Widget.
hovered: StateStyleThe pointer is inside the Widget.
focused: StateStyleThe Widget has keyboard focus.
disabled: StateStyleThe Widget is disabled.
checked: StateStyleThe Widget is checked or selected.
drag_over: StateStyleA drag is over the Widget.
Implementations§
Source§impl Appearance
impl Appearance
Sourcepub fn get(&self, state: VisualState) -> &StateStyle
pub fn get(&self, state: VisualState) -> &StateStyle
Sourcepub fn set(&mut self, state: VisualState, style: StateStyle)
pub fn set(&mut self, state: VisualState, style: StateStyle)
Replaces the style stored for one state.
§Arguments
state- One visual state flag; an empty set (or a flag with no style) setsnormal.style- The new style.
Sourcepub fn effective(&self, state: VisualState) -> StateStyle
pub fn effective(&self, state: VisualState) -> StateStyle
Resolves the style to draw for a set of state flags.
The active states are checked in the order disabled, drag-over, pressed, checked, hovered,
focused; the first one that has a style wins. Fields it leaves unset come from normal.
Fields still unset are None, meaning “use the Widget’s built-in default”.
§Arguments
state- TheWidget’s current visual state flags.
§Returns
The effective style.