Skip to content

Conversation

LeafShi1
Copy link
Member

@LeafShi1 LeafShi1 commented Aug 1, 2025

Fixes #13767

Proposed changes

  • Add judgement IsDarkModeEnabled for FocusForeColor of the CheckedListBox and PropertyGrid

Customer Impact

  • The selected item of the control CheckedListBox and PropertyGrid can be show clearly under DarkMode

Regression?

  • No

Risk

  • Minimal

Screenshots

Before

When the application is in Dark Mode, the contrast of focusing items in CheckedListBox/PropertyGrid is insufficient.

Image

After

The contrast of focusing items in CheckedListBox/PropertyGrid is sufficient

image

Test methodology

  • Manually

Test environment(s)

  • .net 10.0.0-preview.7.25373.104
Microsoft Reviewers: Open in CodeFlow

@LeafShi1 LeafShi1 requested a review from a team as a code owner August 1, 2025 09:30
@github-actions github-actions bot added the area-DarkMode Issues relating to Dark Mode feature label Aug 1, 2025
@LeafShi1 LeafShi1 requested review from Copilot and removed request for a team August 1, 2025 09:30
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves the visual accessibility of CheckedListBox and PropertyGrid controls in dark mode by adjusting their focus foreground colors to provide better contrast.

  • Updates focus foreground color logic to be dark mode-aware
  • Changes color selection from always using SystemColors.HighlightText to conditionally using SystemColors.ControlText in dark mode

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
PropertyGrid.cs Updates _selectedItemWithFocusForeColor field initialization to use dark mode-aware color selection
CheckedListBox.cs Updates foreColor assignment in OnDrawItem method to use dark mode-aware color selection

Copy link

codecov bot commented Aug 1, 2025

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.97766%. Comparing base (ad9d413) to head (9aac464).
⚠️ Report is 41 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #13771         +/-   ##
===================================================
+ Coverage   75.81239%   76.97766%   +1.16527%     
===================================================
  Files           3266        3266                 
  Lines         644057      644057                 
  Branches       47638       47640          +2     
===================================================
+ Hits          488275      495780       +7505     
+ Misses        146556      144599       -1957     
+ Partials        9226        3678       -5548     
Flag Coverage Δ
Debug 76.97766% <0.00000%> (+1.16527%) ⬆️
integration 18.98862% <0.00000%> (?)
production 51.72165% <0.00000%> (+2.60476%) ⬆️
test 97.42226% <ø> (ø)
unit 49.13041% <0.00000%> (+0.01352%) ⬆️

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

@ricardobossan ricardobossan left a comment

Choose a reason for hiding this comment

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

All LGTM!

@KlausLoeffelmann KlausLoeffelmann changed the title Add judgement "IsDarkModeEnabled" for FocusForeColor of the CheckedListBox and PropertyGrid Add check "IsDarkModeEnabled" for FocusForeColor of the CheckedListBox and PropertyGrid Aug 13, 2025
@KlausLoeffelmann
Copy link
Member

Let's take this for 11 - no need for a dual check-in.

Copy link
Member

@KlausLoeffelmann KlausLoeffelmann left a comment

Choose a reason for hiding this comment

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

Looks good to me.
Let's take this for main only, though.

@LeafShi1 LeafShi1 merged commit 9cd3087 into dotnet:main Aug 19, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-DarkMode Issues relating to Dark Mode feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dark Mode: Insufficient contrast for focusing items in CheckedListBox/PropertyGrid
3 participants