@@ -8,12 +8,6 @@ namespace System.Windows.Forms.ButtonInternal;
8
8
9
9
internal class ButtonDarkModeAdapter : ButtonBaseAdapter
10
10
{
11
- // Magic numbers for PushButtonState mapping
12
- private const PushButtonState DisabledPushButtonState = PushButtonState . Disabled ;
13
- private const PushButtonState NormalPushButtonState = PushButtonState . Normal ;
14
- private const PushButtonState PressedPushButtonState = PushButtonState . Pressed ;
15
- private const PushButtonState HotPushButtonState = PushButtonState . Hot ;
16
-
17
11
internal ButtonDarkModeAdapter ( ButtonBase control ) : base ( control ) { }
18
12
19
13
internal override void PaintUp ( PaintEventArgs e , CheckState state )
@@ -55,7 +49,7 @@ internal override void PaintDown(PaintEventArgs e, CheckState state)
55
49
e . Graphics ,
56
50
Control . ClientRectangle ,
57
51
Control . FlatStyle ,
58
- PressedPushButtonState ,
52
+ PushButtonState . Pressed ,
59
53
Control . IsDefault ,
60
54
Control . Focused ,
61
55
Control . ShowFocusCues ,
@@ -84,7 +78,7 @@ internal override void PaintOver(PaintEventArgs e, CheckState state)
84
78
e . Graphics ,
85
79
Control . ClientRectangle ,
86
80
Control . FlatStyle ,
87
- HotPushButtonState ,
81
+ PushButtonState . Hot ,
88
82
Control . IsDefault ,
89
83
Control . Focused ,
90
84
Control . ShowFocusCues ,
@@ -122,13 +116,13 @@ private ColorOptions PaintDarkModeRender(IDeviceContext deviceContext) =>
122
116
private static PushButtonState ToPushButtonState ( CheckState state , bool enabled )
123
117
{
124
118
return ! enabled
125
- ? DisabledPushButtonState
119
+ ? PushButtonState . Disabled
126
120
: state switch
127
121
{
128
- CheckState . Unchecked => NormalPushButtonState ,
129
- CheckState . Checked => PressedPushButtonState ,
130
- CheckState . Indeterminate => HotPushButtonState ,
131
- _ => NormalPushButtonState
122
+ CheckState . Unchecked => PushButtonState . Normal ,
123
+ CheckState . Checked => PushButtonState . Pressed ,
124
+ CheckState . Indeterminate => PushButtonState . Hot ,
125
+ _ => PushButtonState . Normal
132
126
} ;
133
127
}
134
128
}
0 commit comments