Skip to main content

button_spec

Function button_spec 

Source
pub fn button_spec(theme: &Theme, m: &Metrics) -> NodeSpec
Expand description

The standard button’s spec: hover and pressed backgrounds are declared on the node and resolved by the core, so every binding’s button is this same data. Add the label as a child.

The three backgrounds are the theme’s accent trio (accent, accent_hover, accent_pressed): the OS’s accent where the host reports one, the app’s where it set or pinned one, and kui’s blue otherwise. Takes the theme and the metrics rather than reading them, so widgets::button_spec(&ui.theme(), &ui.metrics()) is the idiom. The derivation for any other base colour is button_palette.