pub trait ButtonStyle {
// Required method
fn body(&self, label: AnyPiece) -> AnyPiece;
// Provided method
fn label_color(&self) -> Option<Color> { ... }
}Expand description
A pluggable button appearance (the SwiftUI ButtonStyle analog). Pure composition — a style
builds its body from existing pieces/decorators, so it needs no per-backend native code.
Apply one with Button::style.
Required Methods§
Provided Methods§
Sourcefn label_color(&self) -> Option<Color>
fn label_color(&self) -> Option<Color>
An optional label color applied by Button::style BEFORE the label reaches body.
Defaults to None (the label keeps its intrinsic color). A filled/colored style overrides
this to guarantee contrast — since body gets the label type-erased and cannot recolor it,
this is the seam through which a style tints its label. FilledButtonStyle returns white.