mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-02 02:41:57 +00:00
refactor(eink): Text size and Icon size as schema settings, on opt-in builds only
Review follow-up: - The rows exist only where the build asks for them: Text size with EINK_FONT_SCALE, Icon size with STATUS_ICON_SCALE. The stock 2.13", the portrait builds and the L2 don't get them -- their screens are laid out for one cell size. The text override also applies in landscape only. - Stored in NodePrefs (ui_text_scale, ui_icon_scale) instead of a /ui_scale file, as rows in the schema's Display section: the usual row, save path and factory reset, and console keys display.text.size / display.icon.size. The hand-written Settings rows and the load/save code are gone; UITask::applyUiScale() applies the prefs at boot and on change (applyDisplayPrefs). On opt-in builds ui_text_scale starts at the build's EINK_FONT_SCALE (DataStore sanitize), so the row shows the scale in use. - EINK_FONT_SCALE, when set, now scales whichever landscape font the build picks (the 6x9, or the EINK_LARGE_FONT one); unset, it is stock as before. - setUiScale() skips the re-layout and full redraw when nothing changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -334,6 +334,11 @@ static void sanitize(NodePrefs& p) {
|
||||
flag(p.lock_compact, 0);
|
||||
flag(p.ble_off, 0);
|
||||
if (p.msg_alert > NodePrefs::MSG_ALERT_OFF) p.msg_alert = NodePrefs::MSG_ALERT_NORMAL;
|
||||
if (p.ui_text_scale > NodePrefs::UI_TEXT_SCALE_MAX) p.ui_text_scale = 0;
|
||||
#ifdef EINK_FONT_SCALE // the Text size row shows the scale in use: start at the build's
|
||||
if (p.ui_text_scale == 0) p.ui_text_scale = EINK_FONT_SCALE;
|
||||
#endif
|
||||
if (p.ui_icon_scale > NodePrefs::UI_ICON_SCALE_MAX) p.ui_icon_scale = 0;
|
||||
if (!p.ch_scope_follow) {
|
||||
for (uint8_t i = 0; i < NodePrefs::MAX_SCOPED_CHANNELS; i++)
|
||||
if (p.ch_scope_idx[i] == 0) p.ch_scope_idx[i] = NodePrefs::CH_SCOPE_DEFAULT;
|
||||
|
||||
Reference in New Issue
Block a user