diff options
| author | Jacob Palecki <[email protected]> | 2020-09-01 23:36:52 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2020-09-01 23:36:52 -0700 |
| commit | bf747ca2439a371ef74e21a49c1e8bc880d4d3e2 (patch) | |
| tree | 6265bea551877d84803d731cec7cd0b3b3d823ac /grapher/Models/Options | |
| parent | Second half - the parts in place (diff) | |
| download | rawaccel-bf747ca2439a371ef74e21a49c1e8bc880d4d3e2.tar.xz rawaccel-bf747ca2439a371ef74e21a49c1e8bc880d4d3e2.zip | |
Small fixes, correctly align labels and boxes
Diffstat (limited to 'grapher/Models/Options')
| -rw-r--r-- | grapher/Models/Options/AccelOptionSet.cs | 4 | ||||
| -rw-r--r-- | grapher/Models/Options/Option.cs | 18 |
2 files changed, 16 insertions, 6 deletions
diff --git a/grapher/Models/Options/AccelOptionSet.cs b/grapher/Models/Options/AccelOptionSet.cs index 2d15ad6..e2f2bf7 100644 --- a/grapher/Models/Options/AccelOptionSet.cs +++ b/grapher/Models/Options/AccelOptionSet.cs @@ -12,6 +12,7 @@ namespace grapher.Models.Options { public AccelOptionSet( Label titleLabel, + int topAnchor, AccelTypeOptions accelTypeOptions, Option acceleration, CapOptions cap, @@ -21,6 +22,7 @@ namespace grapher.Models.Options Option midpoint) { TitleLabel = titleLabel; + TopAnchor = topAnchor; AccelTypeOptions = accelTypeOptions; Acceleration = acceleration; Cap = cap; @@ -158,7 +160,7 @@ namespace grapher.Models.Options private void SetOptionsTop(int top) { AccelTypeOptions.Top = top; - Acceleration.Top = AccelTypeOptions.Top+ AccelTypeOptions.Height + Constants.OptionVerticalSeperation; + Acceleration.Top = AccelTypeOptions.Top + AccelTypeOptions.Height + Constants.OptionVerticalSeperation; Cap.SnapTo(Acceleration); Weight.SnapTo(Cap); Offset.SnapTo(Weight); diff --git a/grapher/Models/Options/Option.cs b/grapher/Models/Options/Option.cs index 2006dec..22b78d4 100644 --- a/grapher/Models/Options/Option.cs +++ b/grapher/Models/Options/Option.cs @@ -15,11 +15,17 @@ namespace grapher public Option( Field field, Label label, - ActiveValueLabel activeValueLabel) + ActiveValueLabel activeValueLabel, + int left) { Field = field; Label = label; ActiveValueLabel = activeValueLabel; + Left = left; + + label.AutoSize = false; + label.Width = Field.Left - left - Constants.OptionLabelBoxSeperation; + label.TextAlign = System.Drawing.ContentAlignment.MiddleRight; } public Option( @@ -27,11 +33,13 @@ namespace grapher Form containingForm, double defaultData, Label label, + int left, ActiveValueLabel activeValueLabel) : this( new Field(box, containingForm, defaultData), label, - activeValueLabel) + activeValueLabel, + left) { } @@ -40,6 +48,7 @@ namespace grapher Form containingForm, double defaultData, Label label, + int left, ActiveValueLabel activeValueLabel, string startingName) : this( @@ -47,6 +56,7 @@ namespace grapher containingForm, defaultData, label, + left, activeValueLabel) { SetName(startingName); @@ -89,10 +99,9 @@ namespace grapher { return Label.Left; } - set + private set { Label.Left = value; - Field.Left = value + Label.Width + Constants.OptionLabelBoxSeperation; } } public int Width @@ -111,7 +120,6 @@ namespace grapher { Label.Text = name; //Label.Left = Convert.ToInt32((Field.Box.Left / 2.0) - (Label.Width / 2.0)); //Centered - Left = Label.Left; } public void SetActiveValue(double value) |