mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-26 14:58:12 +00:00
fix(ui): gap below header separator, one method everywhere
Content drawn under the title separator touched the line on every standard screen, because listStart() == headerH() (the row right after the separator). Graphical screens worked around it with a hand-rolled hdr+2. Bake a 2px breathing gap into listStart() so every list gains it at once, and switch the screens that hand-rolled the offset (Compass, Nav, Nearby detail) to listStart() so the content top is computed the same way everywhere. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -33,7 +33,6 @@ public:
|
||||
display.setColor(DisplayDriver::LIGHT);
|
||||
display.drawCenteredHeader("COMPASS");
|
||||
|
||||
const int hdr = display.headerH();
|
||||
const int cx = display.width() / 2;
|
||||
const int ch = display.getLineHeight();
|
||||
const int cw = display.getCharWidth();
|
||||
@@ -41,7 +40,7 @@ public:
|
||||
display.setTextSize(2);
|
||||
const int bigH = display.getLineHeight();
|
||||
display.setTextSize(1);
|
||||
const int top = hdr + 2;
|
||||
const int top = display.listStart();
|
||||
const int readout_y = display.height() - bigH - 1; // size-2 readout baseline
|
||||
const int mid = (top + readout_y) / 2;
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ inline void draw(DisplayDriver& d,
|
||||
geo::fmtDist(dist, sizeof(dist), dist_km, imperial);
|
||||
|
||||
const int step = d.lineStep();
|
||||
int y = hdr + 2;
|
||||
int y = d.listStart();
|
||||
|
||||
// Distance — emphasised at size 2.
|
||||
d.setTextSize(2);
|
||||
|
||||
@@ -404,7 +404,7 @@ class NearbyScreen : public UIScreen {
|
||||
// ── detail rendering ──────────────────────────────────────────────────────────
|
||||
void renderStoredDetail(DisplayDriver& display) {
|
||||
const Entry& e = _entries[_sel];
|
||||
const int hdr = display.headerH();
|
||||
const int hdr = display.listStart(); // content top (gap below the header separator)
|
||||
display.drawInvertedHeader(e.name);
|
||||
|
||||
int step = display.lineStep();
|
||||
@@ -434,7 +434,7 @@ class NearbyScreen : public UIScreen {
|
||||
|
||||
void renderScanDetail(DisplayDriver& display) {
|
||||
const Entry& e = _entries[_sel];
|
||||
const int hdr = display.headerH();
|
||||
const int hdr = display.listStart(); // content top (gap below the header separator)
|
||||
|
||||
char label[32];
|
||||
if (e.name[0]) { strncpy(label, e.name, 31); label[31] = '\0'; }
|
||||
|
||||
Reference in New Issue
Block a user