-
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
Add AppContext switch 'UseSystemRenderingModeAsDefault' for StatusStrip #12624
Add AppContext switch 'UseSystemRenderingModeAsDefault' for StatusStrip #12624
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12624 +/- ##
===================================================
- Coverage 76.01450% 76.00297% -0.01153%
===================================================
Files 3176 3177 +1
Lines 638840 638975 +135
Branches 47169 47175 +6
===================================================
+ Hits 485611 485640 +29
- Misses 149718 149829 +111
+ Partials 3511 3506 -5
Flags with carried forward coverage won't be shown. Click here to find out more. |
src/System.Windows.Forms/tests/TestUtilities/UseSystemRenderingModeAsDefault.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/StatusStripTests.cs
Outdated
Show resolved
Hide resolved
…eringModeAsDefault to UseSystemRenderingModeAsDefaultScope
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.
Overall this is exactly what we suggested in the bug, but I see an issue in the designer scenario when the application sets the AppContext switch, but designer process does not read the application specific switch . Designer process will assume a different default value from the runtime scenario and the user will see different behavior in the designer surface and at the runtime. We should revisit the approach. I.e. default value will not be serialized into the .designer.cs file, and will be interpreted at control initialization time.
@@ -218,4 +220,13 @@ public static bool TreeNodeCollectionAddRangeRespectsSortOrder | |||
[MethodImpl(MethodImplOptions.AggressiveInlining)] | |||
get => GetCachedSwitchValue(TreeNodeCollectionAddRangeRespectsSortOrderSwitchName, ref s_treeNodeCollectionAddRangeRespectsSortOrder); | |||
} | |||
|
|||
/// <summary> | |||
/// Indicates whether to use ToolStripRenderMode.System as the default painting mode for StatusStrip. |
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.
Please use <see cref
around the reference to our types.
/// Indicates whether to use ToolStripRenderMode.System as the default painting mode for StatusStrip. | |
/// Indicates whether to use <see cref="ToolStripRenderMode.System" /> as the default painting mode for <see cref="StatusStrip" />. |
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.
src/System.Windows.Forms/tests/TestUtilities/WinFormsAppContextSwitchNames.cs
Show resolved
Hide resolved
...ystem.Windows.Forms.Primitives/src/System/LocalAppContextSwitches/LocalAppContextSwitches.cs
Show resolved
Hide resolved
src/System.Windows.Forms/tests/TestUtilities/WinFormsAppContextSwitchNames.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/tests/TestUtilities/UseSystemRenderingModeAsDefault.cs
Outdated
Show resolved
Hide resolved
src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/StatusStripTests.cs
Show resolved
Hide resolved
@LeafShi1 - Could you please experiment if we can fix the previous default rendermode - System- to be accessible, i.e. change the hover over color for example? |
will do |
Fixes #12616
Proposed changes
Customer Impact
UseSystemRenderingModeAsDefault
decide whether to use theToolStripRenderMode.System
as the default painting style for the StatusStrip controlRegression?
Risk
Screenshots
Before
A white line in the dialog when using StatusStrip
After
No extra white line the dialog
Test methodology
Test environment(s)
Microsoft Reviewers: Open in CodeFlow