diff options
author | sr55 <[email protected]> | 2016-11-27 12:42:03 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2016-11-27 12:42:26 +0000 |
commit | 82490fe17e0b7f9cd452b1b18e6a5b5a73893d53 (patch) | |
tree | 29f390404804523896ad95bd9bfce51b23f3f7a7 /win/CS/HandBrakeWPF/Controls | |
parent | 75ed9b9b7e89d9ca795e3187a8d23ef70ae3d353 (diff) |
WinGui: Fix the numberbox control for users that have the High Contrast windows theme. The text should now be readable. Fixes #400
Diffstat (limited to 'win/CS/HandBrakeWPF/Controls')
-rw-r--r-- | win/CS/HandBrakeWPF/Controls/NumberBox.xaml.cs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/win/CS/HandBrakeWPF/Controls/NumberBox.xaml.cs b/win/CS/HandBrakeWPF/Controls/NumberBox.xaml.cs index 7a8fc7519..3b86ee783 100644 --- a/win/CS/HandBrakeWPF/Controls/NumberBox.xaml.cs +++ b/win/CS/HandBrakeWPF/Controls/NumberBox.xaml.cs @@ -413,7 +413,7 @@ namespace HandBrakeWPF.Controls this.numberBox.Text = string.Empty;
}
- this.numberBox.Foreground = new SolidColorBrush(Colors.Black);
+ this.numberBox.ClearValue(TextBox.ForegroundProperty);
}
}
@@ -557,14 +557,10 @@ namespace HandBrakeWPF.Controls if (this.AllowEmpty && this.Number == 0)
{
this.numberBox.Text = this.hasFocus ? string.Empty : this.NoneCaption;
-
- // this.numberBox.Foreground = new SolidColorBrush(Colors.Gray);
}
else
{
this.numberBox.Text = this.Number.ToString(CultureInfo.InvariantCulture);
-
- // this.numberBox.Foreground = new SolidColorBrush(Colors.Black);
}
this.RefreshNumberBoxColor();
@@ -575,7 +571,14 @@ namespace HandBrakeWPF.Controls /// </summary>
private void RefreshNumberBoxColor()
{
- this.numberBox.Foreground = this.numberBox.Text == this.NoneCaption ? new SolidColorBrush(Colors.Gray) : new SolidColorBrush(Colors.Black);
+ if (this.numberBox.Text == this.NoneCaption)
+ {
+ this.numberBox.Foreground = new SolidColorBrush(Colors.Gray);
+ }
+ else
+ {
+ this.numberBox.ClearValue(TextBox.ForegroundProperty);
+ }
}
/// <summary>
|