feat(eink): Text size and Icon size settings for big panels

On an 800x480 panel the doubled 6x9 font and the status bar's icons are
tiny. Two opt-in build flags, each also a setting under Settings > Display:

- EINK_FONT_SCALE=<n>: the landscape font's pixel multiplier (stock 2).
  Settings > Display > Text size (1x-5x) overrides it at run time
  (DisplayDriver::setUiScale -> EinkGfxDisplay re-lays out).
- STATUS_ICON_SCALE=<n>: Home's status icons, battery and page-icon row
  drawn at n x their pixel grid, the bar growing to fit. 0 = Auto, 1.5x
  the text's pixel scale. Settings > Display > Icon size (Auto, 1x-8x).

Both live in their own /ui_scale file, so NodePrefs is untouched. Icon size
appears only where STATUS_ICON_SCALE is set; Text size appears on every
e-ink build with the full-refresh setting, and builds that set neither
flag draw as before until it is changed. The GDEQ0426T82 env defaults to
4x text with Auto icons.

Tested in the native sim at 800x480.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KxAZVAbhhYr18Dd4guTQM1
This commit is contained in:
pmow
2026-10-09 11:57:29 -10:00
co-authored by Claude Opus 5.5
parent da5ff56cff
commit 2c1e1fa930
8 changed files with 186 additions and 18 deletions
+9
View File
@@ -62,6 +62,7 @@ class UITask : public UITaskBase, public UiCoreHost {
unsigned long _next_refresh, _auto_off;
bool _display_was_on = true; // loop(): messagesInView() last time round
NodePrefs* _node_prefs;
uint8_t _ui_font_scale = 0; // Settings > Display > Text size (0 = build default)
bool _locked;
bool _tool_from_home = false;
bool messagesInView() const; // Messages on a lit, unlocked display
@@ -520,6 +521,14 @@ public:
bool savePrefsIfDirty(bool& dirty);
void applyRotation();
void applyFullRefreshInterval();
// Settings > Display > Text size / Icon size. Kept in their own /ui_scale
// file rather than NodePrefs, so the prefs schema (and its size assert) is untouched.
uint8_t getUiFontScale() const; // the text's current pixel scale
void setUiFontScale(uint8_t s); // 1..5: applies + saves
uint8_t getStatusIconScale() const; // 0 = Auto (1.5x text), else n
void setStatusIconScale(uint8_t s); // 0..8: applies + saves
void loadUiScale(); // boot-time restore, from begin()
void saveUiScale();
uint32_t autoOffMillis() const {
if (!_node_prefs || _node_prefs->auto_off_secs == 0) return 0;
return (uint32_t)_node_prefs->auto_off_secs * 1000UL;