diff options
| author | JacobPalecki <[email protected]> | 2020-09-22 19:59:47 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-09-22 19:59:47 -0700 |
| commit | 77f420cf45a1a0bee00602965e687097367e2a70 (patch) | |
| tree | fa088af8f2feb54df5bcb6a036715fd32d0511e8 /grapher/Layouts/LayoutBase.cs | |
| parent | Merge pull request #21 from JacobPalecki/GUI (diff) | |
| parent | Update credits (diff) | |
| download | rawaccel-77f420cf45a1a0bee00602965e687097367e2a70.tar.xz rawaccel-77f420cf45a1a0bee00602965e687097367e2a70.zip | |
Merge pull request #22 from JacobPalecki/GUI
Replace SigmoidGain with Motivity & Cleanup
Diffstat (limited to 'grapher/Layouts/LayoutBase.cs')
| -rw-r--r-- | grapher/Layouts/LayoutBase.cs | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/grapher/Layouts/LayoutBase.cs b/grapher/Layouts/LayoutBase.cs index 6ed8fee..b89e2f7 100644 --- a/grapher/Layouts/LayoutBase.cs +++ b/grapher/Layouts/LayoutBase.cs @@ -10,6 +10,7 @@ namespace grapher.Layouts public const string Exponent = "Exponent"; public const string Limit = "Limit"; public const string Midpoint = "Midpoint"; + public const string Motility = "Motility"; public const string Offset = "Offset"; public const string Cap = "Cap"; public const string Weight = "Weight"; @@ -24,15 +25,18 @@ namespace grapher.Layouts MidpointLayout = new OptionLayout(false, string.Empty); ButtonEnabled = true; + LogarithmicCharts = false; } /// <summary> /// Gets or sets mapping from acceleration type to identifying integer. /// Must match accel_mode defined in rawaccel-settings.h /// </summary> - public int Index { get; internal set; } + public int Index { get; protected set; } - public string Name { get; internal set; } + public string Name { get; protected set; } + + public bool LogarithmicCharts { get; protected set; } protected bool ButtonEnabled { get; set; } @@ -58,30 +62,32 @@ namespace grapher.Layouts Button button, int top) { - AccelLayout.Layout(accelOption); - CapLayout.Layout(capOption); - WeightLayout.Layout(weightOption); - OffsetLayout.Layout(offsetOption); - LimExpLayout.Layout(limExpOption); - MidpointLayout.Layout(midpointOption); - button.Enabled = ButtonEnabled; IOption previous = null; - foreach (var option in new IOption[] { accelOption, capOption, weightOption, offsetOption, limExpOption, midpointOption}) + + foreach (var option in new (OptionLayout, IOption)[] { + (AccelLayout, accelOption), + (CapLayout, capOption), + (WeightLayout, weightOption), + (OffsetLayout, offsetOption), + (LimExpLayout, limExpOption), + (MidpointLayout, midpointOption)}) { - if (option.Visible) + option.Item1.Layout(option.Item2); + + if (option.Item2.Visible) { if (previous != null) { - option.SnapTo(previous); + option.Item2.SnapTo(previous); } else { - option.Top = top; + option.Item2.Top = top; } - previous = option; + previous = option.Item2; } } } |