winforms icon indicating copy to clipboard operation
winforms copied to clipboard

Fix All Dark mode Visual Style Renders

Open memoarfaa opened this issue 7 months ago • 3 comments

Fixes #11950 Fixes #11949 Fixes #12909 Fixes #11893 Fixes #11901 Fixes #12040

Proposed changes

  • Enhanced dark mode visual style generation and selection logic, with custom handling for Button, ComboBox, Toolbar, Header, Status, and TreeView controls.
  • Improved consistency and accuracy of dark mode rendering, especially for high-DPI displays.

Customer Impact

  • More visually consistent dark mode experience for end users.
  • High-DPI setups now render dark mode elements correctly and reliably.

Regression?

  • No

Screenshots

Before

https://github.com/user-attachments/assets/b7736281-09db-40ec-9c3d-5c75228a3073

After

https://github.com/user-attachments/assets/b234ea18-dc33-4808-b6c3-0bb39070f002

Test methodology

  • Manual testing across various controls in dark mode and high-DPI environments.
  • Verified correct rendering for affected controls.
  • Ran existing integration tests.

Test environment(s)

  • Tested on Windows 11, Latest .NET 10 SDK build: 10.0.100-preview.6.25311.107

UI scaling,

100% UI scaling and other UI scaling.

Microsoft Reviewers: Open in CodeFlow

memoarfaa avatar Jun 13 '25 18:06 memoarfaa

Hey @memoarfaa,

let's please hold up the dark mode renderer work, until we have the next batch of PRs really merged and committed.

They need to go in this weekend otherwise they might even slip to 11.

After we have them in, we can gradually work on them and further improve.

Thanks!

KlausLoeffelmann avatar Jun 13 '25 19:06 KlausLoeffelmann

Codecov Report

:x: Patch coverage is 16.07143% with 47 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 51.00057%. Comparing base (44e2900) to head (f610037). :warning: Report is 176 commits behind head on main.

:exclamation: There is a different number of reports uploaded between BASE (44e2900) and HEAD (f610037). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (44e2900) HEAD (f610037)
Debug 3 2
test 1 0
Additional details and impacted files
@@                 Coverage Diff                  @@
##                main      #13591          +/-   ##
====================================================
- Coverage   76.59914%   51.00057%   -25.59858%     
====================================================
  Files           3236        2054        -1182     
  Lines         639344      286687      -352657     
  Branches       47314       41953        -5361     
====================================================
- Hits          489732      146212      -343520     
+ Misses        146085      137700        -8385     
+ Partials        3527        2775         -752     
Flag Coverage Δ
Debug 51.00057% <16.07143%> (-25.59858%) :arrow_down:
integration 18.54477% <16.07143%> (+0.00403%) :arrow_up:
production 51.00057% <16.07143%> (-0.00210%) :arrow_down:
test ?
unit 48.41622% <7.14286%> (+0.01859%) :arrow_up:

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.

codecov[bot] avatar Jun 13 '25 19:06 codecov[bot]

Hey @memoarfaa,

let's please hold up the dark mode renderer work, until we have the next batch of PRs really merged and committed.

They need to go in this weekend otherwise they might even slip to 11.

After we have them in, we can gradually work on them and further improve.

Thanks!

No, I want dark mode renderers in 10, so I'm going to turn this pull request into a draft until your pull requests are actually merged and committed.

memoarfaa avatar Jun 13 '25 19:06 memoarfaa

Hey @memoarfaa.

I am closing this PR, because I expect utilizing the native VisualStyle renderers in the OS for WinForms dark mode not to be a sufficiently reliable approach for the foreseeable time. The risk to rely on them is too high.

Let's revisit this, once we have more confidence about their maintenance status.

KlausLoeffelmann avatar Aug 18 '25 18:08 KlausLoeffelmann