-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add check "IsDarkModeEnabled" for FocusForeColor of the CheckedListBox and PropertyGrid #13771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add check "IsDarkModeEnabled" for FocusForeColor of the CheckedListBox and PropertyGrid #13771
Conversation
…stBox and PropertyGrid
There was a problem hiding this 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 |
src/System.Windows.Forms/System/Windows/Forms/Controls/PropertyGrid/PropertyGrid.cs
Show resolved
Hide resolved
src/System.Windows.Forms/System/Windows/Forms/Controls/ListBoxes/CheckedListBox.cs
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is 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
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All LGTM!
Let's take this for 11 - no need for a dual check-in. |
There was a problem hiding this 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.
Fixes #13767
Proposed changes
IsDarkModeEnabled
forFocusForeColor
of the CheckedListBox and PropertyGridCustomer Impact
Regression?
Risk
Screenshots
Before
When the application is in Dark Mode, the contrast of focusing items in CheckedListBox/PropertyGrid is insufficient.
After
The contrast of focusing items in CheckedListBox/PropertyGrid is sufficient
Test methodology
Test environment(s)
Microsoft Reviewers: Open in CodeFlow