fix(ui): make the drop-down's highlighted row visible - #9
Merged
Conversation
The chart and series drop-downs had one invisible row: whichever item was under the cursor rendered as a blank white band, so a chart type could not be picked by sight. Styling QComboBox QAbstractItemView::item gives the popup's rows their own box model, and at that point the view's selection-background-color no longer paints them while selection-color still applies. The highlighted row was therefore drawing white text on a white row. Its selected, hover and focus states are now painted explicitly with the shared cyan highlight and white text, so the drop-down matches the menus, tables and lists. Two tests cover it: the popup must paint its own item states using the shared highlight, and no item-view state anywhere may leave text at less than 4.5:1 against its own row. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
The bug
The chart and series drop-downs had one invisible row: whichever item sat under
the cursor rendered as a blank white band, so a chart type could not be picked
by sight.
Cause
Styling
QComboBox QAbstractItemView::itemgives the popup's rows their own boxmodel. At that point the view's
selection-background-colorno longer paintsthem, while
selection-colorstill applies — so the highlighted row drew whitetext on a white row.
The earlier fix set the popup's
selection-background-color, which is why itlooked correct on inspection and still failed on screen.
Fix
The selected, hover and focus states are painted explicitly with the shared
cyan highlight and white text, so the drop-down now matches the menus, tables
and lists.
Verified
Rendered the real popup and sampled its pixels: the highlighted band reads
#24aeffwith white glyph pixels, where it previously had none.Two tests cover it — the popup must paint its own item states using the shared
highlight, and no item-view state anywhere may leave text under 4.5:1 against
its own row. 121 tests pass.
🤖 Generated with Claude Code