Skip to content

gui: fix device id last character invisibly clipped in deep status bar - #342

Open
wmelonw wants to merge 2 commits into
Blockstream:masterfrom
wmelonw:fix-statusbar-title-clip
Open

gui: fix device id last character invisibly clipped in deep status bar#342
wmelonw wants to merge 2 commits into
Blockstream:masterfrom
wmelonw:fix-statusbar-title-clip

Conversation

@wmelonw

@wmelonw wmelonw commented Aug 30, 2026

Copy link
Copy Markdown

Fixes #341

On Jade Plus (HOME_SCREEN_DEEP_STATUS_BAR, 320x170) the status bar device name can silently lose its last character: the name box is 35% of the padded status bar width = 110px, while the widest possible id (Jade + six wide hex glyphs, e.g. Jade AAAAAA) is 114px in UBUNTU16_FONT. render_text() prints with wrap enabled, so the overflowing character wraps onto a second line that is clipped and never visible. Whether a given unit is affected depends on its id's glyph widths (Jade ABCDEF = 109px fits; ids with more of the wider A/C/D glyphs do not).

Two commits:

  1. gui: widen deep status bar name area (65/35 → 63/37) — 37% = 117px, so the worst-case id always fits. The large logo is left-aligned and unaffected by the 6px narrower left pane.
  2. gui: don't wrap single-line text onto an invisible second line — general guard in render_text(): when the padded box is less than two font-heights tall, truncate to the characters that fit instead of wrapping into clipped space. (Original string restored after printing.)

Verification (QEMU)

Built with Dockerfile.qemu + --webdisplay-larger (BOARD_TYPE_QEMU_LARGER, same 320x170 layout/code path as Jade Plus), with the device id temporarily forced to the worst-case AAAAAA (test hack not included in this PR):

  • master: status bar shows Jade AAAAA — 5 of 6 characters (bug reproduced)
  • this branch: status bar shows Jade AAAAAA — all 6 characters, logo/status icons unaffected

Glyph-width math (UBUNTU16, effective advance incl. spacing): A/C/D = 12px, B = 11px, E/F = 10px, digits = 10px; Jade prefix = 42px.

On Jade Plus (HOME_SCREEN_DEEP_STATUS_BAR, 320x170) the status bar name
box is 35% of the padded width = 110px, but the widest possible device
id ('Jade ' + six wide hex glyphs, eg. 'Jade AAAAAA') is 114px in
UBUNTU16. The overflowing last character wraps onto a second line that
is clipped and never visible, so such units appear to have a 5-char id.

Widen the split to 63/37 (=117px) so the worst-case id always fits.

Verified under qemu (BOARD_TYPE_QEMU_LARGER, same 320x170 layout) with
a forced all-'A' id: before this change the title renders as
'Jade AAAAA'; with it the full 'Jade AAAAAA' is shown.
render_text() prints non-scrolling text with wrap enabled. When a
string is slightly wider than a box that is only one font-line tall,
the overflow wraps onto a second line that is clipped and never
visible - the text appears silently truncated with no indication.

When the padded box is less than two font-heights tall, truncate the
string to the characters that actually fit instead of wrapping. This
is a general guard for any single-line text node (the deep status bar
title was one such case).
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.

Device name (jade_id) last character invisibly clipped in deep status bar on Jade Plus

1 participant