diff options
| author | Jacob Palecki <[email protected]> | 2021-07-01 22:32:55 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2021-07-01 22:32:55 -0700 |
| commit | 308eed9ce9ed48984323e6512546a2ffeb195b14 (patch) | |
| tree | fa35c8ef8240b4598b63e27369dacbcb2b45ffd9 | |
| parent | Begin updating guide (diff) | |
| download | rawaccel-308eed9ce9ed48984323e6512546a2ffeb195b14.tar.xz rawaccel-308eed9ce9ed48984323e6512546a2ffeb195b14.zip | |
LUT Panel formatting
| -rw-r--r-- | doc/images/LUT_example.png | bin | 0 -> 69389 bytes | |||
| -rw-r--r-- | grapher/Layouts/LUTLayout.cs | 4 | ||||
| -rw-r--r-- | grapher/Models/Options/AccelTypeOptions.cs | 6 | ||||
| -rw-r--r-- | grapher/Models/Options/LUT/LutApplyOptions.cs | 8 | ||||
| -rw-r--r-- | grapher/Models/Options/TextOption.cs | 28 |
5 files changed, 38 insertions, 8 deletions
diff --git a/doc/images/LUT_example.png b/doc/images/LUT_example.png Binary files differnew file mode 100644 index 0000000..c89b4b7 --- /dev/null +++ b/doc/images/LUT_example.png diff --git a/grapher/Layouts/LUTLayout.cs b/grapher/Layouts/LUTLayout.cs index e570f6a..1e0037f 100644 --- a/grapher/Layouts/LUTLayout.cs +++ b/grapher/Layouts/LUTLayout.cs @@ -8,8 +8,6 @@ namespace grapher.Layouts { public class LUTLayout : LayoutBase { - public const string LUTLayoutText = "This mode is for advanced users only. Format: x1,y1;x2,y2;...xn,yn;"; - /// <summary> /// String small enough to fit in active value label /// </summary> @@ -30,7 +28,7 @@ namespace grapher.Layouts LimitLayout = new OptionLayout(false, string.Empty); ExponentLayout = new OptionLayout(false, Exponent); MidpointLayout = new OptionLayout(false, string.Empty); - LutTextLayout = new OptionLayout(true, LUTLayoutText); + LutTextLayout = new OptionLayout(true, string.Empty); LutPanelLayout = new OptionLayout(true, string.Empty); LutApplyOptionsLayout = new OptionLayout(true, string.Empty); } diff --git a/grapher/Models/Options/AccelTypeOptions.cs b/grapher/Models/Options/AccelTypeOptions.cs index f43d955..4222d48 100644 --- a/grapher/Models/Options/AccelTypeOptions.cs +++ b/grapher/Models/Options/AccelTypeOptions.cs @@ -83,6 +83,8 @@ namespace grapher LutPanel.Left = AccelDropdown.Left; LutPanel.Width = AccelDropdown.Width + AccelTypeActiveValue.Width; + LutText.SetText(TextOption.LUTLayoutExpandedText, TextOption.LUTLayoutShortenedText); + AccelerationType = Off; Layout(); ShowingDefault = true; @@ -182,7 +184,7 @@ namespace grapher { AccelDropdown.Width = value; LutText.Width = value; - LutPanel.Width = value; + LutPanel.Width = AccelTypeActiveValue.CenteringLabel.Right - AccelDropdown.Left; LutApply.Width = value; } } @@ -258,6 +260,7 @@ namespace grapher Left = Acceleration.Left + Constants.DropDownLeftSeparation; Width = Acceleration.Width - Constants.DropDownLeftSeparation; + LutText.Expand(); } public void ShowShortened() @@ -269,6 +272,7 @@ namespace grapher Left = Acceleration.Field.Left; Width = Acceleration.Field.Width; + LutText.Shorten(); } public void SetArgs(ref AccelArgs args) diff --git a/grapher/Models/Options/LUT/LutApplyOptions.cs b/grapher/Models/Options/LUT/LutApplyOptions.cs index f71c1e2..897460e 100644 --- a/grapher/Models/Options/LUT/LutApplyOptions.cs +++ b/grapher/Models/Options/LUT/LutApplyOptions.cs @@ -10,6 +10,7 @@ namespace grapher.Models.Options.LUT public class LutApplyOptions : OptionBase { public const string LUTApplyOptionsLabelText = "Apply as:"; + public const int LUTApplyLabelDropdownSeparation = 4; public enum LutApplyType { @@ -52,7 +53,8 @@ namespace grapher.Models.Options.LUT Label = label; Label.Text = LUTApplyOptionsLabelText; - Label.Width = 45; + Label.AutoSize = false; + Label.Width = 50; ActiveValueLabel = lutApplyActiveValue; } @@ -93,7 +95,7 @@ namespace grapher.Models.Options.LUT set { Label.Left = value; - ApplyOptions.Left = Label.Left + Label.Width + Constants.OptionLabelBoxSeperation; + ApplyOptions.Left = Label.Left + Label.Width + LUTApplyLabelDropdownSeparation; } } @@ -113,8 +115,8 @@ namespace grapher.Models.Options.LUT } set { - Label.Top = value; ApplyOptions.Top = value; + Label.Top = (ApplyOptions.Height - Label.Height) / 2 + ApplyOptions.Top; ActiveValueLabel.Top = value; } } diff --git a/grapher/Models/Options/TextOption.cs b/grapher/Models/Options/TextOption.cs index 83a72df..1f8034d 100644 --- a/grapher/Models/Options/TextOption.cs +++ b/grapher/Models/Options/TextOption.cs @@ -9,6 +9,13 @@ namespace grapher.Models.Options { public class TextOption : OptionBase { + #region Constants + + public const string LUTLayoutExpandedText = "This mode is for experts only. Format: x1,y1;x2,y2;...xn,yn;"; + public const string LUTLayoutShortenedText = "Experts only."; + + #endregion Constants + #region Constructors public TextOption(Label label) @@ -23,6 +30,10 @@ namespace grapher.Models.Options private Label Label { get; } + private string ExpandedText { get; set; } + + private string ShortenedText { get; set; } + public override bool Visible { get @@ -89,10 +100,25 @@ namespace grapher.Models.Options public override void Show(string Name) { Label.Show(); - Label.Text = Name; ShouldShow = true; } + public void Expand() + { + Label.Text = ExpandedText; + } + + public void Shorten() + { + Label.Text = ShortenedText; + } + + public void SetText(string expandedText, string shortenedText) + { + ExpandedText = expandedText; + ShortenedText = shortenedText; + } + public override void AlignActiveValues() { // Nothing to do here |