summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Controls
diff options
context:
space:
mode:
authorsr55 <[email protected]>2019-08-29 21:58:42 +0100
committersr55 <[email protected]>2019-08-29 21:58:56 +0100
commit3293f1984f227a61dfe0f0d130bad8d09b19025d (patch)
treeabf953b910b2d65719ca971679934cc0125fb097 /win/CS/HandBrakeWPF/Controls
parentaa4c030d83dbc42722facefc00165f063648d1a9 (diff)
WinGui: Various small UI/UX fixes Fixes #2280 #2278
Diffstat (limited to 'win/CS/HandBrakeWPF/Controls')
-rw-r--r--win/CS/HandBrakeWPF/Controls/TimeSpanBox.xaml12
-rw-r--r--win/CS/HandBrakeWPF/Controls/TimeSpanBox.xaml.cs32
2 files changed, 23 insertions, 21 deletions
diff --git a/win/CS/HandBrakeWPF/Controls/TimeSpanBox.xaml b/win/CS/HandBrakeWPF/Controls/TimeSpanBox.xaml
index 3fdc8d22f..4c35bf237 100644
--- a/win/CS/HandBrakeWPF/Controls/TimeSpanBox.xaml
+++ b/win/CS/HandBrakeWPF/Controls/TimeSpanBox.xaml
@@ -143,29 +143,31 @@
TextChanged="NumberBoxTextChanged"
VerticalContentAlignment="Center"/>
<Grid
- Name="incrementButtonsGrid"
+ Name="upButton"
Grid.Column="1"
Width="16">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
- <Button
+ <Button x:Name="incrementButtonsGrid"
Style="{StaticResource UpButton}"
Grid.Row="0"
FontSize="4"
PreviewMouseLeftButtonDown="UpButtonMouseLeftButtonDown"
- PreviewMouseLeftButtonUp="UpButtonMouseLeftButtonUp">
+ PreviewMouseLeftButtonUp="UpButtonMouseLeftButtonUp"
+ PreviewKeyDown="UpButton_OnKeyDown">
<Polygon
Style="{StaticResource Arrow}"
Points="4,0 0,4 8,4" />
</Button>
- <Button
+ <Button x:Name="deIncrementButtonsGrid"
Style="{StaticResource DownButton}"
Grid.Row="1"
FontSize="4"
PreviewMouseLeftButtonDown="DownButtonMouseLeftButtonDown"
- PreviewMouseLeftButtonUp="DownButtonMouseLeftButtonUp">
+ PreviewMouseLeftButtonUp="DownButtonMouseLeftButtonUp"
+ PreviewKeyDown="DownButton_OnKeyDown">
<Polygon
Style="{StaticResource Arrow}"
Points="0,0 8,0 4,4" />
diff --git a/win/CS/HandBrakeWPF/Controls/TimeSpanBox.xaml.cs b/win/CS/HandBrakeWPF/Controls/TimeSpanBox.xaml.cs
index a8277ec3b..9f9c16de1 100644
--- a/win/CS/HandBrakeWPF/Controls/TimeSpanBox.xaml.cs
+++ b/win/CS/HandBrakeWPF/Controls/TimeSpanBox.xaml.cs
@@ -575,8 +575,6 @@ namespace HandBrakeWPF.Controls
this.UpdateNumberBindingFromBox();
}
-
- this.RefreshNumberBoxColor();
}
/// <summary>
@@ -601,8 +599,6 @@ 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
{
@@ -614,19 +610,7 @@ namespace HandBrakeWPF.Controls
{
this.numberBox.Text = this.Number.ToString(CultureInfo.InvariantCulture);
}
-
- // this.numberBox.Foreground = new SolidColorBrush(Colors.Black);
}
-
- this.RefreshNumberBoxColor();
- }
-
- /// <summary>
- /// The refresh number box color.
- /// </summary>
- private void RefreshNumberBoxColor()
- {
- this.numberBox.Foreground = this.numberBox.Text == this.NoneCaption ? new SolidColorBrush(Colors.Gray) : new SolidColorBrush(Colors.Black);
}
/// <summary>
@@ -717,5 +701,21 @@ namespace HandBrakeWPF.Controls
}
#endregion
+
+ private void UpButton_OnKeyDown(object sender, KeyEventArgs e)
+ {
+ if (e.Key == Key.Space)
+ {
+ this.IncrementNumber();
+ }
+ }
+
+ private void DownButton_OnKeyDown(object sender, KeyEventArgs e)
+ {
+ if (e.Key == Key.Space)
+ {
+ this.DecrementNumber();
+ }
+ }
}
} \ No newline at end of file