diff options
| author | Jacob Palecki <[email protected]> | 2020-09-08 12:35:23 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2020-09-08 12:35:23 -0700 |
| commit | a6448c4a2447a090558da5f52dea3dc418389e8a (patch) | |
| tree | 0b985ffcc1551cfdaddb63864904e8f80da335cf /grapher/Models/Options/ActiveValueLabel.cs | |
| parent | Remove and sort usings en masse (diff) | |
| download | rawaccel-a6448c4a2447a090558da5f52dea3dc418389e8a.tar.xz rawaccel-a6448c4a2447a090558da5f52dea3dc418389e8a.zip | |
Fix few small bugs
Diffstat (limited to 'grapher/Models/Options/ActiveValueLabel.cs')
| -rw-r--r-- | grapher/Models/Options/ActiveValueLabel.cs | 28 |
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 } } |