-
Notifications
You must be signed in to change notification settings - Fork 1k
fix #13813 : Dark Mode: The ForeColor & BackColor properties are not working for the controls #13818
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
base: main
Are you sure you want to change the base?
Conversation
src/System.Windows.Forms/System/Windows/Forms/Controls/Buttons/ButtonBase.cs
Outdated
Show resolved
Hide resolved
@@ -170,6 +170,8 @@ private protected override bool OwnerDraw | |||
// ...the user wants to opt out of implicit DarkMode rendering. | |||
&& DarkModeRequestState is true | |||
|
|||
&& !ForeColorSet | |||
&& !BackColorSet |
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.
It's the right approach, if we wanted the set color to change the renderer.
But I think, we should not do it.
We should only take ForeColor and BackColor in DarkMode into account, if the Flat- or the Popup renderer is activated.
And then the question is: Could we "just" figure out, if Back/ForeColor should be serialized with the current setting, and if, only then take that color then into account for the Back and ForeColor renderer?
src/System.Windows.Forms/System/Windows/Forms/Controls/TextBox/TextBoxBase.cs
Outdated
Show resolved
Hide resolved
Hey @Epica, could you see why the test fails and then squash the commits and rebase? Thanks for your help! |
…e not working for the controls
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #13818 +/- ##
===================================================
- Coverage 77.10728% 77.10244% -0.00485%
===================================================
Files 3273 3273
Lines 644882 644929 +47
Branches 47688 47692 +4
===================================================
+ Hits 497251 497256 +5
- Misses 143958 144001 +43
+ Partials 3673 3672 -1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
@KlausLoeffelmann |
Fixes #13813
Proposed changes
Add code to see if BackColor or ForeColor is specified in dark mode, if so then use the specified color, if not then let the renderer decide the color.
Screenshots
Before
After