rmp::ui::Button
A button: text, an icon, or both.
text
The label; empty for an icon-only button
icon
Shown before the label, or alone
icon_size, icon_above, variant, size, width, height, enabled, id, style, on_click, on_hover, on_unhover, on_press, on_release, on_focus, on_blur
The icon's height in design units; 0 = the label's type size (or the picture's own height when there is no label).
icon_above: True: the icon over the label, as a toolbar tile
variant: As ButtonOptions::style
size: A step or design units, as ButtonOptions::size
width: > 0 = a fixed width; 0 = as the immediate one
height: > 0 = a fixed height
enabled: False = drawn disabled; no press, no change, no focus
id: As ButtonOptions::id: only for two with one label
style: Its own look; see Style
on_click: Clicked: released on it, or Enter or A with the focus
on_hover: The pointer arrived on it
on_unhover: ...and left
on_press: The pointer went down on it
on_release: ...and came up
on_focus: The keyboard or gamepad focus arrived
on_blur: ...and left
show
Lays it out here, runs the callbacks of what happened, and says whether it was clicked — if (play.show()) works as well as on_click.
Lays it out here
shake, hovered, pressed, focused
Shakes it side to side (its style's Motion), plays its shake sound and sends EventKind::SHAKE: "that did not work". Starts at the next show().
shake: Shakes it, as Button::shake() does
hovered: The pointer is on it
pressed: Held down on it
focused: It has the focus
ours
What it remembers; read it with the methods above