From 2492467f44f9fab43778cd3274b0d2c5abab9a2a Mon Sep 17 00:00:00 2001 From: John Lewin Date: Sat, 14 Apr 2018 12:56:55 -0700 Subject: [PATCH] Remove local implementation in favor of common extension method --- CustomWidgets/SimpleButton.cs | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/CustomWidgets/SimpleButton.cs b/CustomWidgets/SimpleButton.cs index 8931dc36f..36b87a470 100644 --- a/CustomWidgets/SimpleButton.cs +++ b/CustomWidgets/SimpleButton.cs @@ -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