Skip to content

Commit 85d701e

Browse files
Fix DarkMode StatusStrip background renderer.
1 parent 330a7c6 commit 85d701e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/System.Windows.Forms/System/Windows/Forms/Controls/ToolStrips/StatusStrip.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public override DockStyle Dock
118118
set => base.LayoutStyle = value;
119119
}
120120

121-
// we do some custom stuff with padding to accomodate size grip.
121+
// we do some custom stuff with padding to accommodate size grip.
122122
// changing this is not supported at DT
123123
[Browsable(false)]
124124
public new Padding Padding

src/System.Windows.Forms/System/Windows/Forms/Controls/ToolStrips/ToolStripSystemRenderer.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,9 +766,10 @@ private static void RenderStatusStripBorder(ToolStripRenderEventArgs e)
766766
}
767767
}
768768

769+
#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
769770
private static void RenderStatusStripBackground(ToolStripRenderEventArgs e)
770771
{
771-
if (Application.RenderWithVisualStyles)
772+
if (!Application.IsDarkModeEnabled && Application.RenderWithVisualStyles)
772773
{
773774
VisualStyleRenderer vsRenderer = VisualStyleRenderer!;
774775
vsRenderer.SetParameters(VisualStyleElement.Status.Bar.Normal);
@@ -782,6 +783,7 @@ private static void RenderStatusStripBackground(ToolStripRenderEventArgs e)
782783
}
783784
}
784785
}
786+
#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
785787

786788
private static void RenderLabelInternal(ToolStripItemRenderEventArgs e)
787789
{

0 commit comments

Comments
 (0)