diff options
| author | Jacob Palecki <[email protected]> | 2021-04-06 00:42:58 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2021-04-06 00:42:58 -0700 |
| commit | 399aaf96f863029206fc672a1dc4b556ed456c58 (patch) | |
| tree | 5decdb1fb713c263685945714cf64bc609576cd6 /grapher/Models/Options/CheckBoxOption.cs | |
| parent | Resize vertically for correctness (diff) | |
| download | rawaccel-399aaf96f863029206fc672a1dc4b556ed456c58.tar.xz rawaccel-399aaf96f863029206fc672a1dc4b556ed456c58.zip | |
Fix checkbox not snapping
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; } } |