mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-08-04 11:16:13 +00:00
feat(ui): pill unread badges, unified DM/CH headers, trimmed home carousel
UI-polish trio from CODE_REVIEW (biggest "feels finished" gain per line): - Pill unread badges: new DisplayDriver::drawUnreadBadge()/unreadBadgeWidth() draw a filled capsule with the count knocked out (corners knocked back for a rounded look; inverts on a selected row). Replaces the bare right-aligned digits in MODE_SELECT, the contact/channel pickers and favourites tiles. No <stdio.h> in the header — fmtBadgeCount formats manually, clamps to 99+. - Unified DM/CH history headers: DM_HIST and CHANNEL_HIST drew their titles by hand (drawTextCentered + fillRect at lh+1), a different height/separator than every other screen. Both now route through drawCenteredHeader(). - Trimmed default home carousel: new NodePrefs::HP_DEFAULT (Clock, Tools, Shutdown, Favourites, Map; Messages + Settings always visible = 7 pages). applyDefaults() seeds it instead of HP_ALL. Recent/Radio/BT/Advert/GPS/Sensors are opt-in via Settings > Home Pages. Existing users keep their saved mask — factory default only; no migration, no schema bump. Both solo envs build green (OLED RAM 69.9%/Flash 62.8%; e-ink SUCCESS). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -403,6 +403,13 @@ struct NodePrefs { // persisted to file
|
||||
static const uint16_t HP_FAVOURITES = 1 << HPB_FAVOURITES;
|
||||
static const uint16_t HP_MAP = 1 << HPB_MAP;
|
||||
static const uint16_t HP_ALL = 0x01FF | HP_FAVOURITES | HP_MAP;
|
||||
// Factory-default carousel — the everyday pages only, so a fresh device isn't
|
||||
// 13 pages to joystick through. Messages + Settings are always visible (no
|
||||
// mask bit), so the mask covers: Clock, Tools, Shutdown, Favourites, Map.
|
||||
// Recent / Radio / Bluetooth / Advert / GPS / Sensors are opt-in via
|
||||
// Settings › Home Pages. Existing users keep their saved mask (loaded from
|
||||
// /new_prefs); this only seeds brand-new / factory-reset devices.
|
||||
static const uint16_t HP_DEFAULT = HP_CLOCK | HP_TOOLS | HP_SHUTDOWN | HP_FAVOURITES | HP_MAP;
|
||||
|
||||
// Label for home page by bit-index; returns "" for out-of-range.
|
||||
// Array indices match HomePageBit values.
|
||||
|
||||
Reference in New Issue
Block a user