diff options
| author | Jacob Palecki <[email protected]> | 2021-04-25 21:57:25 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2021-04-25 21:57:25 -0700 |
| commit | 0af5b1d23be9ecfb0134c957197cfd8f838b7998 (patch) | |
| tree | 0e98a6cf933742d14d93c0feded2845aeda3beba /grapher | |
| parent | update signed (diff) | |
| download | rawaccel-0af5b1d23be9ecfb0134c957197cfd8f838b7998.tar.xz rawaccel-0af5b1d23be9ecfb0134c957197cfd8f838b7998.zip | |
Fixed layout issues for LUT
Diffstat (limited to 'grapher')
| -rw-r--r-- | grapher/Layouts/LUTLayout.cs | 7 | ||||
| -rw-r--r-- | grapher/Layouts/LayoutBase.cs | 2 | ||||
| -rw-r--r-- | grapher/Models/Options/AccelTypeOptions.cs | 2 | ||||
| -rw-r--r-- | grapher/Models/Options/TextOption.cs | 9 |
4 files changed, 18 insertions, 2 deletions
diff --git a/grapher/Layouts/LUTLayout.cs b/grapher/Layouts/LUTLayout.cs index 5505114..1ca5915 100644 --- a/grapher/Layouts/LUTLayout.cs +++ b/grapher/Layouts/LUTLayout.cs @@ -10,6 +10,11 @@ namespace grapher.Layouts { public const string LUTLayoutText = "This mode is for advanced users only. It requires a lut.json file to define the velocity curve. See the guide for specifics."; + /// <summary> + /// String small enough to fit in active value label + /// </summary> + public const string LUTActiveName = "LUT"; + public LUTLayout() : base() { @@ -27,5 +32,7 @@ namespace grapher.Layouts MidpointLayout = new OptionLayout(false, string.Empty); LUTTextLayout = new OptionLayout(true, LUTLayoutText); } + + public override string ActiveName => LUTActiveName; } } diff --git a/grapher/Layouts/LayoutBase.cs b/grapher/Layouts/LayoutBase.cs index 900d611..82d10d8 100644 --- a/grapher/Layouts/LayoutBase.cs +++ b/grapher/Layouts/LayoutBase.cs @@ -38,6 +38,8 @@ namespace grapher.Layouts public string Name { get; protected set; } + public virtual string ActiveName { get => Name; } + public bool LogarithmicCharts { get; protected set; } protected OptionLayout AccelLayout { get; set; } diff --git a/grapher/Models/Options/AccelTypeOptions.cs b/grapher/Models/Options/AccelTypeOptions.cs index 62a923d..e79e767 100644 --- a/grapher/Models/Options/AccelTypeOptions.cs +++ b/grapher/Models/Options/AccelTypeOptions.cs @@ -215,7 +215,7 @@ namespace grapher public void SetActiveValues(ref AccelArgs args) { AccelerationType = AccelTypeFromSettings(ref args); - AccelTypeActiveValue.SetValue(AccelerationType.Name); + AccelTypeActiveValue.SetValue(AccelerationType.ActiveName); GainSwitch.SetActiveValue(args.legacy); Weight.SetActiveValue(args.weight); Cap.SetActiveValue(args.cap); diff --git a/grapher/Models/Options/TextOption.cs b/grapher/Models/Options/TextOption.cs index 292b805..3c6f378 100644 --- a/grapher/Models/Options/TextOption.cs +++ b/grapher/Models/Options/TextOption.cs @@ -29,7 +29,7 @@ namespace grapher.Models.Options { get { - return Label.Visible; + return Label.Visible || ShouldShow; } } @@ -77,15 +77,22 @@ namespace grapher.Models.Options } } + private bool ShouldShow + { + get; set; + } + public override void Hide() { Label.Hide(); + ShouldShow = false; } public override void Show(string Name) { Label.Show(); Label.Text = Name; + ShouldShow = true; } public override void AlignActiveValues() |