diff options
Diffstat (limited to 'grapher/Models/Options/CheckBoxOption.cs')
| -rw-r--r-- | grapher/Models/Options/CheckBoxOption.cs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/grapher/Models/Options/CheckBoxOption.cs b/grapher/Models/Options/CheckBoxOption.cs index 43757b4..83b2d7a 100644 --- a/grapher/Models/Options/CheckBoxOption.cs +++ b/grapher/Models/Options/CheckBoxOption.cs @@ -7,6 +7,7 @@ namespace grapher.Models.Options public CheckBoxOption(CheckBox checkBox) { CheckBox = checkBox; + Show(string.Empty); } public CheckBox CheckBox { get; } @@ -15,7 +16,7 @@ namespace grapher.Models.Options { get { - return CheckBox.Visible; + return CheckBox.Visible || ShouldShow; } } @@ -63,6 +64,13 @@ namespace grapher.Models.Options } } + /// <summary> + /// For some reason, setting CheckBox.Show() does not result in visible not being true on GUI startup. + /// This is inconsistent with the other options, which do. + /// Keep this bool for allowing Visible to still be the signal for option snapping. + /// </summary> + private bool ShouldShow { get; set; } + public override void AlignActiveValues() { } @@ -70,11 +78,15 @@ namespace grapher.Models.Options public override void Hide() { CheckBox.Hide(); + ShouldShow = false; + CheckBox.Enabled = false; } public override void Show(string Name) { CheckBox.Show(); + ShouldShow = true; + CheckBox.Enabled = true; CheckBox.Name = Name; } } |