Skip to content

fix(ui): thread dithered foreground through textStyleWithForeground - #67

Open
Belphemur wants to merge 1 commit into
Free-Ink:mainfrom
Belphemur:fix/disabled-row-text-dim
Open

fix(ui): thread dithered foreground through textStyleWithForeground#67
Belphemur wants to merge 1 commit into
Free-Ink:mainfrom
Belphemur:fix/disabled-row-text-dim

Conversation

@Belphemur

Copy link
Copy Markdown
Contributor

Summary

A disabled ListItem (or any control whose resolved style carries a dithered foreground) rendered pixel-identical to an enabled one — its disabled state was invisible.

Root cause

textStyleWithForeground() (libs/ui/FreeInkUI/src/FreeInkUI.cpp) only copied the color when foreground.kind == PaintKind::Solid. A disabled list row resolves to dither(Color::LightGray) (a Dither paint), so TextStyle.color stayed at its default Black. Downstream, the renderer's text() computed dithered = false and took the solid-black path — the gray foreground never reached the dithered text rasterizer.

Fix

Handle PaintKind::Dither in textStyleWithForeground() by copying the color (and not forcing inverted), so the renderer's dithered text path renders the gray label. The disabled row background is intentionally left as solid(White) — only the label text dims to gray. This complements the existing drawTextDither rasterizer plumbing, which previously received no gray color to draw.

Scope

  • Single-file change in libs/ui/FreeInkUI/src/FreeInkUI.cpp (no API/struct changes, no other callers affected).
  • No clang-format in this repo; edit hand-styled to match the surrounding ~100-col hand style.

Verification

  • FreeInkUI host harness (libs/ui/FreeInkUI/test/host/test_freeinkui.cpp): 2796 checks, 0 failed.

AI Usage

YES — agent-assisted.

A disabled list row (e.g. ListItem with enabled=false) resolves to a
dither(LightGray) foreground, but textStyleWithForeground only copied the
color for Solid paints. The Dither foreground fell back to TextStyle's
default Black, so the rasterizer took the solid-black path and the row
rendered pixel-identical to an enabled one — its disabled state was
invisible.

Handle PaintKind::Dither by copying the color (and not forcing inverted),
so the renderer's dithered text path renders the gray label. The disabled
row background is intentionally left as solid White; only the label dims.

Host harness: 2796 checks, 0 failed.
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.

1 participant