Add Dark Mode Visual Style Theme Subclass
This is an improvement to new Dark Mode experimental feature https://github.com/dotnet/winforms/pull/11857 see https://learn.microsoft.com/en-us/windows/win32/controls/theme-subclasses#two-ways-to-use-a-theme-subclass
Fixes https://github.com/dotnet/winforms/issues/11893. Fixes https://github.com/dotnet/winforms/issues/11953.
Microsoft Reviewers: Open in CodeFlow
@dotnet-policy-service agree
في الأحد، ٢٥ أغسطس ٢٠٢٤ ٨:٤٩ م dotnet-policy-service[bot] < @.***> كتب:
(Translation: on Sun، 25 August 2024 8:49 PM dotnet-policy-service[bot] < @.***> wrote:)
Assigned #11985 https://github.com/dotnet/winforms/pull/11985 to @memoarfaa https://github.com/memoarfaa.
— Reply to this email directly, view it on GitHub https://github.com/dotnet/winforms/pull/11985#event-14004926109, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC7KK2CGY675YZFK4S663ZDZTIKK5AVCNFSM6AAAAABNCXIQDKVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJUGAYDIOJSGYYTAOI . You are receiving this because you were assigned.Message ID: @.***>
@KlausLoeffelmann @JeremyKuhne @merriemcgaw @lonitra - if this fixes the rendering issue, this change would be a great addition to the .NET 9 release.
As long as I can use the new API to set color mode on my entire application from my settings form at runtime at any time to switch between light and dark mode I would be happy in the .NET 9 release.
Also what about all of the system menus in all the possible controls as well? Are they dark themed with this change now or do I have to go into black magic to convert them to ContextMenuStrips that I set then a custom dark theme renderer to that is not rounded. Yes, I feel like an easier way of doing this is inside of Winforms would be a good idea (where winforms converts them to a ContextMenuStrip that auto themes it to light or dark) for the application and to a global setting for if they want all ContextMenuStrips to be rounded or not would make me happy as well but that can come in .NET 10 on that change.
Codecov Report
Attention: Patch coverage is 25.80645% with 46 lines in your changes missing coverage. Please review.
Project coverage is 75.06842%. Comparing base (
8cdb3e0) to head (2ac8c87). Report is 754 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #11985 +/- ##
===================================================
+ Coverage 75.03366% 75.06842% +0.03476%
===================================================
Files 3063 3063
Lines 632075 632114 +39
Branches 46784 46800 +16
===================================================
+ Hits 474269 474518 +249
+ Misses 154431 154218 -213
- Partials 3375 3378 +3
| Flag | Coverage Δ | |
|---|---|---|
| Debug | 75.06842% <25.80645%> (+0.03476%) |
:arrow_up: |
| integration | 17.94234% <16.12903%> (+0.08534%) |
:arrow_up: |
| production | 48.22065% <25.80645%> (+0.08131%) |
:arrow_up: |
| test | 97.01607% <ø> (-0.00029%) |
:arrow_down: |
| unit | 45.24617% <22.58065%> (-0.00481%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
Closing this PR, as the author did not come back for a while to address requested issues.
We collected other suggestions over the time, which we'll start to implement now.
Please again note, that there is no urgency or necessity to rush these fixes for servicing, since Dark Mode is experimental, and experimental Features are never serviced.