-
Notifications
You must be signed in to change notification settings - Fork 991
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
Enable DarkMode Theming #10985
Enable DarkMode Theming #10985
Conversation
Test failures are caused by white space analyzer errors.
|
src/System.Windows.Forms/src/System/Windows/Forms/ActiveX/AxHost.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/Application.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/Controls/ListView/ListView.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/Controls/ToolStrips/ToolStripManager.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/DarkModeSettings.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/Application.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/Theming/ForcedLightThemedSystemColors.cs
Outdated
Show resolved
Hide resolved
@KlausLoeffelmann
I understand that I've already annoyed everyone with this question, but still... At this stage, what can you say about Theming and MDI (#3691)? |
That it's not at all likely that it will be addressed in the underlaying layer, which WinForms "just" wraps around. I know it's a disappointing condition, and we're affected ourselves: namely the Designer document (Form) Window. We might be able to brush-up the rendering of the Window title in the WinForms Designer, but it'll only be possible with NC-custom painting. That might work in this case, because the Window is pretty static. But I wouldn't touch it, to be honest, for moving parts. |
5b767df
to
038bcbf
Compare
038bcbf
to
3701417
Compare
I personally do not like the extensive usage of Also if by default the non-client area used said type derived from Also having it like this would promote people to ship special nuget packages that people can install and pass in to their application to use a theme they created using a type derived from |
Please read my comments on theming in the respective issue. Thanks! |
The |
fbc724b
to
5e189d3
Compare
5e189d3
to
8d3b64e
Compare
7974a57
to
3191e93
Compare
src/System.Windows.Forms/src/System/Windows/Forms/Application.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/Application.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/Application.cs
Outdated
Show resolved
Hide resolved
9fd3e34
to
bace995
Compare
83ca34e
to
cf32e9c
Compare
src/System.Windows.Forms/src/System/Windows/Forms/Controls/TextBox/TextBoxBase.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/src/System/Windows/Forms/Controls/TextBox/TextBoxBase.cs
Outdated
Show resolved
Hide resolved
@@ -2425,37 +2430,20 @@ private unsafe void SetFormCornerPreferenceInternal(FormCornerPreference cornerP | |||
[Experimental(DiagnosticIDs.ExperimentalDarkMode, UrlFormat = Application.WinFormsExperimentalUrl)] | |||
public Color FormBorderColor |
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.
How to return to the orignal System default Color with this api?
(DWMWA_COLOR_DEFAULT with value 0xFFFFFFFF)
How to remove 1px border color around Form with this api ?
(DWMWA_COLOR_NONE with value 0xFFFFFFFE)
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.
Good catch! I will test and add this to the docs! Nice one - adds real value!
src/System.Windows.Forms/src/System/Windows/Forms/Controls/TextBox/TextBoxBase.cs
Show resolved
Hide resolved
|
||
/// <summary> | ||
/// The appearance of a Modern UI toggle switch. | ||
/// This setting is not taken into account, when <see cref="VisualStylesMode"/> is set |
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.
The second part of this should be a remarks section.
@@ -633,14 +633,14 @@ internal static ApplyGraphicsProperties GetApplyStateFlags(IDeviceContext device | |||
// flag when this was originally written. | |||
|
|||
Debug.Assert(apply.HasFlag(ApplyGraphicsProperties.Clipping) | |||
|| graphics.Clip is null |
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.
This file needs undone.
float radius = rect.Height / 2f; | ||
|
||
using var path = new GraphicsPath(); | ||
path.AddArc(rect.X, rect.Y, radius * 2, radius * 2, 180, 90); |
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.
Is this a rounded rectangle?
|
||
private readonly ConcurrentDictionary<AnimatedControlRenderer, AnimationRendererItem> _renderer = []; | ||
|
||
private readonly WindowsFormsSynchronizationContext? _syncContext = (WindowsFormsSynchronizationContext?)SynchronizationContext.Current; |
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.
You're going to be grabbing this for whatever the thread happens to be that the static Instance runs on. Is this really what you want? I presume you'd be better off just calling SynchronizationContext.Currrent?.Post()
inline.
Locked the discussion, since we need to separate this out into different PRs. |
Important!I've made the extremely hard decision to bump this feature's release to 10. This was coming in awfully hot for .NET 9 RC1 and wasn't looking like everything we needed to do internally (t's crossed and i's dotted) could be addressed in time to meet code complete, which is in just a couple of days. Rather than try to force it into RC1 I decided the best course of action will be to move it to 10 and have it ready to go well before the first preview. Given the bake time it will have in the next release, I think we can be confident of a successful release in 10. Those of you who are invested in the Dark Mode and VisualStyles work - we want all of the feedback that we can get. You will be able to start seeing builds with this feature work in a few weeks at most when .NET repos move Main to target .NET 10. We have every confidence in this feature and are looking forward to having it ready for you with the very first builds of .NET 10 for your evaluation. If you have any questions, please don't hesitate to ask on the main issue #7641. |
Looks like the dark-mode landed in .NET 9 afterall --> #11857 |
Indeed it did! We were able to separate it from the bigger Visual Styles work and get it in for .NET 9. Huge Kudos to @KlausLoeffelmann and @JeremyKuhne for the heroics over the weekend to make sure we had this for .NET 9. Without their above and beyond efforts we would not have been able to make code-complete. Please use and provide feedback! |
Fixes #7641.
Ready for another review pass. We're still aiming for RC1.
There is one test issue left, which will be addressed during next week.