fix(ui): thread dithered foreground through textStyleWithForeground - #67
Open
Belphemur wants to merge 1 commit into
Open
fix(ui): thread dithered foreground through textStyleWithForeground#67Belphemur wants to merge 1 commit into
Belphemur wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 whenforeground.kind == PaintKind::Solid. A disabled list row resolves todither(Color::LightGray)(aDitherpaint), soTextStyle.colorstayed at its defaultBlack. Downstream, the renderer'stext()computeddithered = falseand took the solid-black path — the gray foreground never reached the dithered text rasterizer.Fix
Handle
PaintKind::DitherintextStyleWithForeground()by copying the color (and not forcinginverted), so the renderer's dithered text path renders the gray label. The disabled row background is intentionally left assolid(White)— only the label text dims to gray. This complements the existingdrawTextDitherrasterizer plumbing, which previously received no gray color to draw.Scope
libs/ui/FreeInkUI/src/FreeInkUI.cpp(no API/struct changes, no other callers affected).clang-formatin this repo; edit hand-styled to match the surrounding ~100-col hand style.Verification
libs/ui/FreeInkUI/test/host/test_freeinkui.cpp): 2796 checks, 0 failed.AI Usage
YES — agent-assisted.