-
Notifications
You must be signed in to change notification settings - Fork 1k
Fix DarkMode (a) StatusStrip background renderer A11Y Regression. #13360
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: main
Are you sure you want to change the base?
Fix DarkMode (a) StatusStrip background renderer A11Y Regression. #13360
Conversation
aae8556
to
85d701e
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #13360 +/- ##
===================================================
- Coverage 62.58082% 62.57018% -0.01065%
===================================================
Files 1560 1560
Lines 159763 159763
Branches 14915 14915
===================================================
- Hits 99981 99964 -17
- Misses 59007 59024 +17
Partials 775 775
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
cd504d7
to
504b21a
Compare
8e9ff57
to
5ea89b6
Compare
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 addresses several A11Y regressions related to DarkMode rendering by removing experimental diagnostic attributes and refining related rendering logic. Key changes include the removal of experimental DarkMode attributes in form APIs, the introduction and integration of a dedicated dark mode renderer in ToolStripSystemRenderer, and various rendering improvements in ToolStripRenderer and StatusStrip.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
FormCornerPreference.cs | Removed experimental diagnostic attribute for DarkMode support. |
Form.cs | Removed experimental attribute on DarkMode–related properties and events. |
ToolStripSystemRenderer.cs | Introduced a dedicated dark mode renderer and updated RendererOverride logic. |
ToolStripRenderer.cs | Updated rendering paths and optimized array initializations for DarkMode disabled images. |
ToolStrip.cs | Modified background painting to use renderer overrides when available. |
StatusStrip.cs | Updated comment spelling for clarity. |
PublicAPI.Unshipped.txt | Updated API documentation entries for FormCornerPreference and related events. |
Comments suppressed due to low confidence (6)
src/System.Windows.Forms/System/Windows/Forms/FormCornerPreference.cs:11
- Verify that the removal of the experimental DarkMode diagnostic attribute is intended and that any related tooling or documentation has been updated accordingly.
-[Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = DiagnosticIDs.UrlFormat)]
src/System.Windows.Forms/System/Windows/Forms/Form.cs:2185
- Ensure that removing the experimental attribute from the Form properties aligns with production readiness for DarkMode, and update any related diagnostic handling as needed.
- [Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = DiagnosticIDs.UrlFormat)]
src/System.Windows.Forms/System/Windows/Forms/Controls/ToolStrips/StatusStrip.cs:121
- Correct the spelling of 'accomodate' to 'accommodate' in the comment for clarity.
// we do some custom stuff with padding to accomodate size grip.
src/System.Windows.Forms/System/Windows/Forms/Controls/ToolStrips/ToolStripSystemRenderer.cs:18
- Confirm that prioritizing high contrast mode over dark mode in the RendererOverride is intended and that the newly introduced dark mode renderer meets accessibility guidelines.
+ private ToolStripRenderer? _toolStripDarkModeRenderer;
src/System.Windows.Forms/System/Windows/Forms/Controls/ToolStrips/ToolStripRenderer.cs:855
- Review the logic change for rendering item check images to ensure that returning early when the image rectangle is empty or the image is null does not inadvertently skip intended rendering in edge cases.
+ if (imageRect == Rectangle.Empty || image is null)
src/System.Windows.Forms/System/Windows/Forms/Controls/ToolStrips/ToolStrip.cs:3651
- [nitpick] Ensure that using the renderer override to draw the ToolStrip background and returning early does not conflict with any custom rendering requirements that downstream consumers might have.
+ if (Renderer.RendererOverride is ToolStripRenderer renderer)
31d85bf
to
3e3ed3f
Compare
3a1b788
to
031811f
Compare
Fixes #12909.
Fixes #12663.
Fixes #12041.
Fixes #12040.
Fixes #12027.
Microsoft Reviewers: Open in CodeFlow