mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-08-05 03:36:13 +00:00
refactor(ui): shared drawList + header + key-decode helpers
- drawList(): scrollable list skeleton (visible window, keep-sel-in-view, scroll-column reserve, per-row callback, indicator). Migrate Tools, Bot, Nearby, Waypoints list and the three QuickMsg lists onto it; centralises the scroll-clamp/reserve/indicator that each had open-coded (and inconsistently). - drawCenteredHeader(): centred title + separator, replacing the duplicated two-liner across ~10 screens (incl. QuickMsg, which used width()/2 spacing and was missed before); unifies the separator at headerH()-sepH(). - keyIsPrev()/keyIsNext() in UIScreen.h for the LEFT||PREV / RIGHT||NEXT idiom; applied to 6 screens, behaviour-preserving. Cancel/context-menu stay per-screen (they mean different things on different screens). - rotLabel() dedups the 0/90/180/270 array in Settings. - Unify selection-row height to lineStep()-1 (Tools/Bot matched the rest). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -76,8 +76,7 @@ public:
|
||||
: "TRAIL";
|
||||
char title[20];
|
||||
snprintf(title, sizeof(title), "%s %d/%d", base, (int)_view + 1, (int)V_COUNT);
|
||||
display.drawTextCentered(display.width() / 2, 0, title);
|
||||
display.fillRect(0, display.headerH() - 1, display.width(), display.sepH());
|
||||
display.drawCenteredHeader(title);
|
||||
|
||||
if (_view == V_MAP) renderMap(display);
|
||||
else if (_view == V_LIST) renderList(display);
|
||||
|
||||
Reference in New Issue
Block a user