Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,12 @@ private Color GetButtonTextColor(IDeviceContext deviceContext, PushButtonState s
{
Color textColor;

if (Control.ForeColor != Forms.Control.DefaultForeColor)
if (Control.ShouldSerializeForeColor())
{
textColor = new ColorOptions(deviceContext, Control.ForeColor, Control.BackColor)
{
Enabled = Control.Enabled
}.Calculate().WindowText;

if (IsHighContrastHighlighted())
{
textColor = SystemColors.HighlightText;
}
}
else
{
Expand All @@ -53,14 +48,9 @@ private Color GetButtonBackColor(PushButtonState state)
{
Color backColor;

if (Control.BackColor != Forms.Control.DefaultBackColor)
if (!Control.UseVisualStyleBackColor || Control.ShouldSerializeBackColor())
{
backColor = Control.BackColor;

if (IsHighContrastHighlighted())
{
backColor = SystemColors.HighlightText;
}
}
else
{
Expand Down