Icons: small images of their own size for pages

Bitmaps that only pages use (backgrounds, images by state) are now icons:
own width and height, stored in /icons, not in the page lists or the Home
Assistant dropdowns. Page backgrounds and image elements use icons or
bitmaps; the renderer gets icons expanded at the top left, so pages look
the same. Web UI: Icons tab with an editor, Make icon / Make bitmap, Save
as icon on the Draw tab, icons in the backup.

A one-time migration in time-boxed steps moves the uploaded bitmaps that
only pages use, after the new firmware is marked good.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mangavalkandClaude Opus 5.5 committed 2026-10-16 22:03:18 +02:00
1 parent 1704cbf17b
commit ab001e5d18
37 files changed
+955 -78

No files matched your search

+13 -3
View File
@@ -7,6 +7,7 @@
#include "display/frames.h"
#include "display/status_screen.h"
#include "logic/display_controller.h"
#include "logic/icon_format.h"
#include "logic/local_time.h"
#include "logic/loop_stats.h"
#include "logic/page.h"
@@ -48,11 +49,20 @@ void appPageLoop(bool time_valid, const LocalTime &time);
// Left on the dots when the display switches off: OFF_PAGE_BLANK or a bitmap name
const char *appSelectOffPage(const char *name);
// Bitmaps, dynamic pages and fonts: stored, and the display redrawn when it shows them.
// Bitmaps and pages share one namespace; what a page uses can't be deleted. All return
// nullptr or an error message.
// Bitmaps, icons, dynamic pages and fonts: stored, and the display redrawn when it shows
// them. Bitmaps, icons and pages share one namespace; what a page uses can't be deleted.
// All return nullptr or an error message.
const char *appSaveBitmap(const char *name, const uint8_t *bitmap);
const char *appDeleteBitmap(const char *name);
const char *appSaveIcon(const char *name, const Icon &icon);
const char *appDeleteIcon(const char *name);
// A bitmap becomes an icon (cut to its dots from the top left, so pages look the same) and
// the other way around; not for bitmaps that are shown on their own
const char *appBitmapToIcon(const char *name);
const char *appIconToBitmap(const char *name);
// Once: the uploaded bitmaps that only pages use become icons. Call from loop(); returns at
// once when it is done.
void appMigrateIcons();
const char *appSavePage(const char *name, const DynamicPage &page);
const char *appDeletePage(const char *name);
const char *appSaveFont(const char *name, const uint8_t *data, size_t size);