Skip to main content

Module image_button

Module image_button 

Source
Expand description

Tappable button that draws a borrowed raster image instead of (or alongside) a text label.

Interaction mirrors Button: the press registers on TouchPhase::Down (sets pressed, emits no message), and the message fires on TouchPhase::Up if pressed is still set. The runtime re-marks pressed each frame via mark_pressed, so the press survives the Down/Up gesture; dragging off before release cancels it, since a press that no longer lands isn’t re-asserted on the next rebuild.

Styling is resolved through the theme’s ButtonCatalog using the widget’s ButtonClass and current Status, exactly like Button. The image is blitted via Renderer::draw_image centered in the upper part of the button, with an optional label drawn beneath it.

Structs§

ImageButton
Tappable button whose face is a borrowed raster image, with an optional text label below it.