Remove local implementation in favor of common extension method

This commit is contained in:
John Lewin 2018-04-14 12:56:55 -07:00
parent a65ac330bc
commit 2492467f44

View file

@ -279,7 +279,7 @@ namespace MatterHackers.MatterControl.CustomWidgets
_checked = value;
if (_checked)
{
UncheckAllOtherRadioButtons();
this.UncheckSiblings();
}
this.BackgroundColor = (_checked) ? theme.MinimalShade : Color.Transparent;
@ -298,26 +298,11 @@ namespace MatterHackers.MatterControl.CustomWidgets
{
if (this.Checked)
{
graphics2D.Rectangle(0, 0, LocalBounds.Right, 2, ActiveTheme.Instance.PrimaryAccentColor);
graphics2D.Rectangle(0, 0, LocalBounds.Right, 2, theme.Colors.PrimaryAccentColor);
}
base.OnDraw(graphics2D);
}
private void UncheckAllOtherRadioButtons()
{
if (SiblingRadioButtonList != null)
{
foreach (GuiWidget child in SiblingRadioButtonList.Distinct())
{
var radioButton = child as IRadioButton;
if (radioButton != null && radioButton != this)
{
radioButton.Checked = false;
}
}
}
}
}
public class TextButton : SimpleButton