From a0d536cf909f26a8fa79ec3f68c97ac01f15beee Mon Sep 17 00:00:00 2001 From: Jakub <106778416+MarekZegare4@users.noreply.github.com> Date: Mon, 15 Jun 2026 17:30:43 +0200 Subject: [PATCH] feat(ui): scroll indicator in fullscreen message view Replace the old ^/v scroll arrows with the proportional scroll indicator (thumb + triangle caps) used by the list screens. Reserve its right-edge column and re-wrap the message text to the narrower width so nothing renders under it. Co-Authored-By: Claude Opus 4.8 --- .../ui-new/FullscreenMsgView.h | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/examples/companion_radio/ui-new/FullscreenMsgView.h b/examples/companion_radio/ui-new/FullscreenMsgView.h index 0d81ebdc..5c7c7537 100644 --- a/examples/companion_radio/ui-new/FullscreenMsgView.h +++ b/examples/companion_radio/ui-new/FullscreenMsgView.h @@ -2,6 +2,7 @@ #include #include +#include "icons.h" static const int FS_CHARS_MAX = 80; // max bytes per wrapped line @@ -103,6 +104,12 @@ struct FullscreenMsgView { display.translateUTF8ToBlocks(trans_text, body, sizeof(trans_text)); char lines[12][FS_CHARS_MAX]; int lcount = wrapLines(display, trans_text, max_px, lines, 12); + // Reserve the right-edge column for the scroll indicator and re-wrap so text + // can't run under it. Reserve appears only once the list overflows, and a + // narrower second pass only ever yields more lines — so it stays overflowing. + int reserve = scrollIndicatorReserve(display, lcount, visible); + if (reserve > 0) + lcount = wrapLines(display, trans_text, max_px - reserve, lines, 12); int max_scroll = lcount > visible ? lcount - visible : 0; if (scroll > max_scroll) scroll = max_scroll; @@ -110,20 +117,7 @@ struct FullscreenMsgView { display.setCursor(0, startY + i * lineH); display.print(lines[scroll + i]); } - if (scroll > 0) { - display.setColor(DisplayDriver::DARK); - display.fillRect(display.width() - cw, startY, cw, lineH); - display.setColor(DisplayDriver::LIGHT); - display.setCursor(display.width() - cw, startY); - display.print("^"); - } - if (scroll < max_scroll) { - display.setColor(DisplayDriver::DARK); - display.fillRect(display.width() - cw, startY + (visible - 1) * lineH, cw, lineH); - display.setColor(DisplayDriver::LIGHT); - display.setCursor(display.width() - cw, startY + (visible - 1) * lineH); - display.print("v"); - } + drawScrollIndicator(display, startY, visible * lineH, lcount, visible, scroll); const int nav_y = display.height() - lineH; if (has_next) { display.setCursor(0, nav_y);