From 1bf90ed2fb0b7d76197361c3ea5ce6ac9b630f8c Mon Sep 17 00:00:00 2001 From: Jakub <106778416+MarekZegare4@users.noreply.github.com> Date: Thu, 18 Jun 2026 15:33:18 +0200 Subject: [PATCH] fix(ui): drop popup menu's header gap, tighten row tiling PopupMenu is compact and stands alone (no full-screen header to separate from), so the gap meant for listStart() just wasted vertical space and let the selection bar's edges miss the box border by a few px. Co-Authored-By: Claude Sonnet 4.6 --- examples/companion_radio/ui-new/PopupMenu.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/companion_radio/ui-new/PopupMenu.h b/examples/companion_radio/ui-new/PopupMenu.h index dd3f3d56..48d248a4 100644 --- a/examples/companion_radio/ui-new/PopupMenu.h +++ b/examples/companion_radio/ui-new/PopupMenu.h @@ -41,8 +41,9 @@ struct PopupMenu { const int item_h = lh + 2; // row pitch const int pad = 4; // inner left/right padding const int margin = 4; // gap to the screen edge - const int gap = 2; // breathing room below the separator (matches listStart()) - const int title_h = lh + 2 + sh + gap; // title text + scaled separator + gap + // Compact menu: rows tile straight under the separator (no header gap here — + // unlike full screens) so the selection bar fills its cell edge to edge. + const int title_h = lh + 2 + sh; // title text + scaled separator // Hard ceiling: never show more rows than physically fit on screen. int avail_h = display.height() - margin * 2 - title_h - 2; @@ -78,7 +79,7 @@ struct PopupMenu { if (bw < min_bw) bw = min_bw; if (bw > max_bw) bw = max_bw; - int bh = title_h + vis * item_h + 2; + int bh = title_h + vis * item_h + 1; // +1 keeps the last row off the bottom border // Centre on screen (clamped to the margins on small displays). int bx = (display.width() - bw) / 2;