Skip to content

Conversation

ricardobossan
Copy link
Member

@ricardobossan ricardobossan commented Oct 10, 2025

Fixes #13901

Root Cause

ColorEditor.ColorUI and CursorEditor.CursorUI use owner-draw ListBoxes with custom OnDrawItem handlers that use DrawItemEventArgs.ForeColor for text rendering. In Dark Mode, this property returns dark text color for selected items, creating poor contrast against the bright blue selection background.

Proposed changes

  • Modified ColorEditor.ColorUI.OnListDrawItem() to use SystemColors.ControlText for selected item text in Dark Mode
  • Modified CursorEditor.CursorUI.OnDrawItem() to use SystemColors.ControlText for selected item text in Dark Mode

Customer Impact

Users can now properly read selected items in PropertyGrid color and cursor dropdowns when using Dark Mode.

Regression?

No

Risk

Minimal

Screenshots

Before

Screenshot 2025-10-09 210129

After

Screenshot 2025-10-09 204857 Screenshot 2025-10-09 204806 Screenshot 2025-10-09 204840

Test methodology

Manual testing

Test environment(s)

  • 10.0.100-rc.1.25420.111
Microsoft Reviewers: Open in CodeFlow

`ColorEditor.ColorUI` and `CursorEditor.CursorUI` use owner-draw ListBoxes with custom `OnDrawItem` handlers that use `DrawItemEventArgs.ForeColor` for text rendering. In Dark Mode, this property returns dark text color for selected items, creating poor contrast against the bright blue selection background.

- Modified `ColorEditor.ColorUI.OnListDrawItem()` to use `SystemColors.ControlText` for selected item text in Dark Mode
- Modified `CursorEditor.CursorUI.OnDrawItem()` to use `SystemColors.ControlText` for selected item text in Dark Mode

Users can now properly read selected items in `PropertyGrid` color and cursor dropdowns when using Dark Mode.

No

Minimal

Manual testing

- 10.0.100-rc.1.25420.111
@ricardobossan ricardobossan requested a review from a team as a code owner October 10, 2025 00:05
@ricardobossan ricardobossan self-assigned this Oct 10, 2025
@ricardobossan ricardobossan added waiting-review This item is waiting on review by one or more members of team and removed needs-area-label labels Oct 10, 2025
Copy link

codecov bot commented Oct 10, 2025

Codecov Report

❌ Patch coverage is 0% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.14958%. Comparing base (f812cb6) to head (5f00f95).
⚠️ Report is 24 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #13950         +/-   ##
===================================================
- Coverage   77.16116%   77.14958%   -0.01158%     
===================================================
  Files           3273        3276          +3     
  Lines         644919      645126        +207     
  Branches       47694       47707         +13     
===================================================
+ Hits          497627      497712         +85     
- Misses        143607      143727        +120     
- Partials        3685        3687          +2     
Flag Coverage Δ
Debug 77.14958% <0.00000%> (-0.01158%) ⬇️
integration 18.98665% <0.00000%> (-0.07867%) ⬇️
production 52.01145% <0.00000%> (-0.03432%) ⬇️
test 97.40947% <ø> (-0.00310%) ⬇️
unit 49.46058% <0.00000%> (+0.05230%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@LeafShi1 LeafShi1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-review This item is waiting on review by one or more members of team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dark Mode: Insufficient contrast for focusing items on DropDownPanel of BackColor/ForeColor/Cursor properties in PropertyGrid

2 participants