Files
Juli 3bdfcba6fb Selectable UI themes and a Popular source
Themes (Phosphor, Pink, Amber, Ice, Terminal) restyle the menu, boot
page and toasts live from the menu; all but Terminal use readable
Montserrat text. Source gains Popular: the top-rated listings walked in
rank order from page 1, alternating providers when mixed.
2026-09-17 03:11:25 +02:00

44 lines
1.7 KiB
C

#pragma once
#include <stdbool.h>
#include <stdint.h>
// All calls take the LVGL lock themselves; safe from any task.
void ui_init(void);
// Colour/font themes for the system pages (menu, status, toast).
int ui_theme_count(void);
const char *ui_theme_name(int idx);
void ui_set_theme(int idx);
// Full-screen text page (boot, Wi-Fi setup, fatal errors).
void ui_status(const char *title, const char *msg);
// Switch to the camera page.
void ui_show_camera_page(void);
// Hand a freshly decoded 320x170 RGB565 frame to the canvas. The buffer stays
// owned by the caller and must not be written until the next swap.
void ui_present_frame(uint16_t *rgb565);
void ui_set_caption(const char *place, const char *meta);
// Badge in the top-right corner: "LIVE", "PAUSED", "..." — NULL hides it.
void ui_set_badge(const char *text, uint32_t rgb);
// 0..1000 countdown bar; <0 hides the bar.
void ui_set_progress(int permille);
void ui_toast(const char *msg, uint32_t ms);
void ui_set_overlay_visible(bool visible);
bool ui_overlay_visible(void);
// Small marker in the top-left corner of the camera page ("FAV 3"); NULL hides it.
void ui_set_marker(const char *text);
// Battery readout at the right end of the caption bar; NULL hides it.
void ui_set_battery(const char *text);
// --- menu page ---
#define UI_MENU_ROWS 6
typedef struct {
const char *label;
const char *value; // right-aligned; may be NULL
bool dim; // informational row, drawn greyed
} ui_menu_row_t;
// Draws rows[top .. top+UI_MENU_ROWS) with `selected` highlighted; `editing` recolours the value.
void ui_menu_show(const char *title, const ui_menu_row_t *rows, int count, int top, int selected, bool editing);
void ui_menu_hide(void);