summaryrefslogtreecommitdiff
path: root/grapher/Models/Options/ActiveValueLabel.cs
diff options
context:
space:
mode:
Diffstat (limited to 'grapher/Models/Options/ActiveValueLabel.cs')
-rw-r--r--grapher/Models/Options/ActiveValueLabel.cs28
1 files changed, 25 insertions, 3 deletions
diff --git a/grapher/Models/Options/ActiveValueLabel.cs b/grapher/Models/Options/ActiveValueLabel.cs
index df7ac42..18a4400 100644
--- a/grapher/Models/Options/ActiveValueLabel.cs
+++ b/grapher/Models/Options/ActiveValueLabel.cs
@@ -22,11 +22,12 @@ namespace grapher.Models.Options
public ActiveValueLabel(Label valueLabel, Label centeringLabel)
{
ValueLabel = valueLabel;
- ValueLabel.ForeColor = Constants.ActiveValueFontColor;
- Left = centeringLabel.Left;
- Width = centeringLabel.Width;
ValueLabel.AutoSize = false;
ValueLabel.TextAlign = ContentAlignment.MiddleCenter;
+ ValueLabel.ForeColor = Constants.ActiveValueFontColor;
+
+ CenteringLabel = centeringLabel;
+ Align();
FormatString = Constants.DefaultActiveValueFormatString;
Prefix = string.Empty;
@@ -98,6 +99,21 @@ namespace grapher.Models.Options
}
}
+ public int Height
+ {
+ get
+ {
+ return ValueLabel.Height;
+ }
+
+ set
+ {
+ ValueLabel.Height = value;
+ }
+ }
+
+ public Label CenteringLabel { get; }
+
#endregion Properties
#region Methods
@@ -127,6 +143,12 @@ namespace grapher.Models.Options
ValueLabel.Text = string.IsNullOrWhiteSpace(Prefix) ? Value: $"{Prefix}: {Value}";
}
+ public void Align()
+ {
+ Left = CenteringLabel.Left;
+ Width = CenteringLabel.Width;
+ }
+
#endregion Methods
}
}