Skip to content

Commit 4ad1d39

Browse files
Refactor ToolStripRenderer classes and improve generic and GDIPlus Copilot Instruction files.
1 parent a15b534 commit 4ad1d39

File tree

4 files changed

+142
-167
lines changed

4 files changed

+142
-167
lines changed

src/System.Windows.Forms/System/Windows/Forms/Control.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,13 +279,13 @@ public unsafe partial class Control :
279279
private Font? _scaledControlFont;
280280
private FontHandleWrapper? _scaledFontWrapper;
281281

282+
// Contains a collection of calculated fonts for various Dpi values of the control in the PerMonV2 mode.
283+
private Dictionary<int, Font>? _dpiFonts;
284+
282285
// ContainerControls like 'PropertyGrid' scale their children when they resize.
283286
// no explicit scaling of children required in such cases. They have specific logic.
284287
internal bool _doNotScaleChildren;
285288

286-
// Contains a collection of calculated fonts for various Dpi values of the control in the PerMonV2 mode.
287-
private Dictionary<int, Font>? _dpiFonts;
288-
289289
// Flag to signify whether any child controls necessitate the calculation of AnchorsInfo,
290290
// particularly in cases involving nested containers.
291291
internal bool _childControlsNeedAnchorLayout;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,12 +1130,14 @@ private protected static void OnRenderStatusStripSizingGrip(
11301130
if (Environment.OSVersion.Version >= new Version(10, 0, 22000)
11311131
&& statusStrip.FindForm() is Form f)
11321132
{
1133+
#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.
11331134
cornerDef = f.FormCornerPreference switch
11341135
{
11351136
FormCornerPreference.Round => (4, new(1, 1, 2, 2)),
11361137
FormCornerPreference.RoundSmall => (3, new(1, 1, 2, 2)),
11371138
_ => (2, new(0, 0, 2, 2))
11381139
};
1140+
#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.
11391141
}
11401142

11411143
return cornerDef;

0 commit comments

Comments
 (0)