Skip to content
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

Dark mode experimental feature #11857

Merged
merged 2 commits into from
Aug 12, 2024
Merged

Conversation

JeremyKuhne
Copy link
Member

@JeremyKuhne JeremyKuhne commented Aug 11, 2024

The first commit pulls from @KlausLoeffelmann's https://github.com/dotnet/winforms/pull/10985/files. Styling features and non-critical changes were stripped out to make this the smallest change possible.

The second commit are my changes to address my feedback on the original PR mentioned above.

Microsoft Reviewers: Open in CodeFlow

Pulled from https://github.com/dotnet/winforms/pull/10985/files. Styling features and non-critical changes were stripped out to make this the smallest change possible.
Copy link
Contributor

@paul1956 paul1956 left a comment

Choose a reason for hiding this comment

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

Please put back <OptionInfer>Off</OptionInfer>
It should not affect anything in .Net 9 or going forward.

@dotnet-policy-service dotnet-policy-service bot added the 📭 waiting-author-feedback The team requires more information from the author label Aug 11, 2024
Copy link

codecov bot commented Aug 11, 2024

Codecov Report

Attention: Patch coverage is 29.67581% with 282 lines in your changes missing coverage. Please review.

Project coverage is 74.79107%. Comparing base (1ff332e) to head (0d6ae9a).

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #11857         +/-   ##
===================================================
- Coverage   74.82010%   74.79107%   -0.02903%     
===================================================
  Files           3016        3018          +2     
  Lines         629649      629987        +338     
  Branches       46737       46777         +40     
===================================================
+ Hits          471104      471174         +70     
- Misses        155180      155429        +249     
- Partials        3365        3384         +19     
Flag Coverage Δ
Debug 74.79107% <29.67581%> (-0.02903%) ⬇️
integration 18.02555% <23.55890%> (-0.00704%) ⬇️
production 47.78105% <29.82456%> (-0.03257%) ⬇️
test 97.00807% <0.00000%> (+0.00029%) ⬆️
unit 44.80768% <22.55639%> (-0.03257%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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 like a surprising compromise, customers will be really happy about.
Unit tests pass, I did a series of exploratory tests, also in conjunction with my async feature, I merged earlier, and this version of the dark mode feature looks really good! What an amazing and surprising ride this was! Lifetime experience! So glad, we made this for .NET 9!

- Move Experimental URL to DiagnosticIds
- Move special dark mode logic from CreateBrushScope to GetSysColorBrush
- Remove unnecessary logic in FindNearestColor
- Update brushes and pens by poking SystemEvents static directly
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.

🕶️
:shipit:

@JeremyKuhne JeremyKuhne merged commit 59f982c into dotnet:main Aug 12, 2024
8 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the 9.0 RC1 milestone Aug 12, 2024
@JeremyKuhne JeremyKuhne deleted the darkmodesep branch August 12, 2024 01:09
@Philip-Wang01
Copy link
Contributor

Verified this issue in the release/9.0, Dark Mode feature works fine, but there are still some GitHub issues to track.
image

}

/// <summary>
/// Sets or gets the Form's title bar back color.
Copy link
Member

Choose a reason for hiding this comment

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

this should have been text color in the summary.

@Zheng-Li01
Copy link
Member

Verified the issue with .NET 9.0.100-rc.1.24422.10 test pass build, for now the Dark mode have been supported for .NET WinForm project.

@creizlein
Copy link

I'm sorry if this is not the right place to ask this, but how can we test it? I am running sdk 9 preview 7 and cant get winforms project to recognize Application.SetDefaultDarkMode at all
Is it avail on 9.0.100-preview.7 or I need to grab and compile sdk 9.0 rc1 manually?

Please feel free to delete this post if totally out of topic, apologize in advance.

@Zheng-Li01
Copy link
Member

Zheng-Li01 commented Aug 29, 2024

@creizlein Please install the 9.0 rc1 form https://github.com/dotnet/sdk/blob/main/documentation/package-table.md try to see if Application.SetDefaultDarkMode is available or not if you can access.

@Zheng-Li01
Copy link
Member

Verified the issue with .NET 9.0.100-rc.1.24452.12 test pass build, for now the Dark mode have been supported for .NET WinForm project.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[API Suggestion] Introduce Dark Mode and A11Y compatible Visual Styles for Apps targeting .NET 9 and Win 11
8 participants