ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_widget_nav_bar_t Struct Reference

An equal-cell navigation strip: N labels, one active, each tappable. More...

#include <ra8_widget_nav_bar.h>

Detailed Description

An equal-cell navigation strip: N labels, one active, each tappable.

Caller-owned plain data bound to a ra8_widget_t with ra8_widget_nav_bar_init. items is a caller-owned array of count NUL-terminated labels; active is the highlighted (inked) index; selected records the last cell a touch hit. render splits the rect into count equal-width cells and centres each label (active -> fg_active, else fg_muted). on_input maps a touch X to a cell index, stores it in selected, and fires on_select – the caller decides whether to move active in response.

Invariant
active < count (else no item is inked).
selected holds a valid cell index after any touch is consumed.
Example:
static const char* const items[] = {"Library", "Store", "Settings"};
ra8_widget_nav_bar_t nav = {.paint = &paint, .items = items, .count = 3,
.active = 0, .bg = 0x00FFFFFFU,
.fg_active = 0x00101010U, .fg_muted = 0x00A0A0A0U};
ra8_widget_t w = {};
(void)ra8_widget_nav_bar_init(&w, &nav);
struct ra8_widget ra8_widget_t
ra8_err_t ra8_widget_nav_bar_init(ra8_widget_t *w, ra8_widget_nav_bar_t *nav)
Bind a widget instance to a navigation strip.
An equal-cell navigation strip: N labels, one active, each tappable.
See also
ra8_widget_nav_bar_init
Since
0.1.0

The documentation for this struct was generated from the following file: