Notifications
Toasts and modal dialogues drawn over your app
The firmware owns one notification. Every function here acts on it, so there is nothing to allocate or free — pass NULL wherever a ui_notify_t* is asked for.
Warning — A modal notification swallows input: while it is up the firmware consumes button events before your on_input() sees them and drains the encoder accumulator, so the first os_controls_encoder_get_delta() afterwards reads 0. Do not drive your UI from on_input() while a modal is showing.
Toast: header + hint + optional icon.
| const char* | header | |
| const char* | hint | |
| const gfx_img_t* | icon | |
| uint16_t | timeout_ms | 0 = stay until hidden |
Error toast
| const char* | message | |
| uint16_t | timeout_ms |
Success toast
| const char* | message | |
| uint16_t | timeout_ms |
Warning toast
| const char* | message | |
| uint16_t | timeout_ms |
Yes/no dialogue; callback fires on confirm
| const char* | message | |
| const gfx_img_t* | icon | |
| void (*callback)(void*, void*) | ||
| void* | callback_ctx |
static void on_erase(void* ctx, void* unused) { (void)unused; wipe(ctx); }
ui_notify_confirm("Erase all?", NULL, on_erase, m);Text dialogue with a callback
| const char* | text | |
| void (*callback)(void*, void*) | ||
| void* | callback_ctx |
Popup whose callback reports which way it was dismissed
| const char* | header | |
| const char* | hint | |
| const gfx_img_t* | icon | |
| void (*callback)(void*, bool) | ||
| void* | callback_ctx |
Hide the current notification. Pass NULL.
| ui_notify_t* | n |
Is a notification showing?
Is this notification visible? Pass NULL for the current one.
| const ui_notify_t* | n |
Make the next notification modal (swallows input — see the warning above)
| bool | modal |
Show or hide the confirm button
| bool | show |
Move the notification on screen
| const uint16_t | x | |
| const uint16_t | y |