Skip to content

fix: doubled selection pill title when hardware indicator is shown#782

Merged
frysee merged 1 commit into
LoveRetro:mainfrom
ericreinsmidt:fix/selection-pill-text-doubling
Jul 19, 2026
Merged

fix: doubled selection pill title when hardware indicator is shown#782
frysee merged 1 commit into
LoveRetro:mainfrom
ericreinsmidt:fix/selection-pill-text-doubling

Conversation

@ericreinsmidt

@ericreinsmidt ericreinsmidt commented Jul 17, 2026

Copy link
Copy Markdown

Summary

Fixes a bug where the selected list item's title renders doubled / ghosted whenever a hardware indicator (volume, brightness, or color temperature) is shown while sitting on a stationary selection.

Root cause

The selected item's title is drawn twice, by design:

  1. The list loop bakes the title into the screen at x = SCALE1(BUTTON_MARGIN + BUTTON_PADDING).
  2. The animated pill-text overlay (globalText) is drawn on top of it.

Two of the three globalText draw sites use that same x, so the overlay lands exactly on the baked copy and the label reads as a single crisp string.

The static-redraw path used x = SCALE1(PADDING + BUTTON_PADDING) instead. That path runs every frame while a volume/brightness/colortemp indicator is held on a stationary selection, so the overlay was drawn SCALE1(PADDING - BUTTON_MARGIN) = SCALE1(5) to the right of the baked title — producing the doubled/ghosted label.

Fix

Align the static-redraw draw site with the other two (nextui.c), so the overlay always sits directly on top of the baked title:

-GFX_drawOnLayer(globalText, SCALE1(PADDING+BUTTON_PADDING), pilltargetTextY, ...);
+GFX_drawOnLayer(globalText, SCALE1(BUTTON_MARGIN + BUTTON_PADDING), pilltargetTextY, ...);

One line, shared code — applies to all platforms.

Testing

Built with the correct per-platform toolchains and verified on hardware:

Device Platform Before After
Trimui Smart Pro S tg5050 doubled text with indicator held crisp ✓
Trimui Brick tg5040 (not visibly doubled) crisp, no regression ✓

Both boot normally and render the selected pill correctly during and after the indicator is shown.

Note on tg5040 visibility

The doubling was only visible on tg5050, even though the code path is shared. On tg5040 the second (offset) copy stayed hidden because that platform composites the baked title differently — it presents through /dev/fb0, so the misaligned overlay copy was covered rather than shown. The fix is a no-op there visually (the overlay already coincides with the baked title after alignment) and was confirmed on hardware to introduce no regression or position shift.

Before (TSP-S)

tsp-s_pill_doubling_BEFORE

After (TSP-S)

tsp-s_pill_doubling_AFTER

The selected list item's title is baked into the screen by the list
loop at x = SCALE1(BUTTON_MARGIN + BUTTON_PADDING), and the animated
pill-text overlay (globalText) is drawn on top of it. Two of the three
overlay draw sites use that same x, so the overlay lands exactly on the
baked copy and the label reads as a single crisp string.

The static-redraw path used x = SCALE1(PADDING + BUTTON_PADDING)
instead. That path runs every frame while a volume/brightness/colortemp
indicator is held on a stationary selection, so the overlay was drawn
SCALE1(PADDING - BUTTON_MARGIN) = SCALE1(5) to the right of the baked
title, producing a doubled/ghosted label.

Align this draw site with the other two so the overlay always sits on
top of the baked title.
@frysee
frysee force-pushed the fix/selection-pill-text-doubling branch from 96eeacd to 063d802 Compare July 19, 2026 14:52
@frysee
frysee merged commit 983cae5 into LoveRetro:main Jul 19, 2026
61 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants