summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorsr55 <[email protected]>2018-04-29 15:09:09 +0100
committersr55 <[email protected]>2018-05-01 18:46:25 +0100
commit31b85071c2330ed6974052d1f0f765a513275b97 (patch)
treea1001bc33447ed1ef9242e1bf2349033e582c17b /win
parent1adbdca9f2ce54002ec16c7fdf03eabd6d30de33 (diff)
WinGui: Improve the Number Box control. 1. Add support for Up/Down Arrow to increase/decrease the number. 2. Remove tab stop from the buttons. #1311
Diffstat (limited to 'win')
-rw-r--r--win/CS/HandBrakeWPF/Controls/NumberBox.xaml4
-rw-r--r--win/CS/HandBrakeWPF/Controls/NumberBox.xaml.cs9
2 files changed, 11 insertions, 2 deletions
diff --git a/win/CS/HandBrakeWPF/Controls/NumberBox.xaml b/win/CS/HandBrakeWPF/Controls/NumberBox.xaml
index 1a9dbe6af..d1f6ce1d7 100644
--- a/win/CS/HandBrakeWPF/Controls/NumberBox.xaml
+++ b/win/CS/HandBrakeWPF/Controls/NumberBox.xaml
@@ -151,7 +151,7 @@
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Button AutomationProperties.Name="Increase Number"
- Style="{StaticResource UpButton}"
+ Style="{StaticResource UpButton}" IsTabStop="False"
Grid.Row="0"
FontSize="4"
PreviewMouseLeftButtonDown="UpButtonMouseLeftButtonDown"
@@ -161,7 +161,7 @@
Points="4,0 0,4 8,4" />
</Button>
<Button AutomationProperties.Name="Decrease Number"
- Style="{StaticResource DownButton}"
+ Style="{StaticResource DownButton}" IsTabStop="False"
Grid.Row="1"
FontSize="4"
PreviewMouseLeftButtonDown="DownButtonMouseLeftButtonDown"
diff --git a/win/CS/HandBrakeWPF/Controls/NumberBox.xaml.cs b/win/CS/HandBrakeWPF/Controls/NumberBox.xaml.cs
index 3b86ee783..1de00800f 100644
--- a/win/CS/HandBrakeWPF/Controls/NumberBox.xaml.cs
+++ b/win/CS/HandBrakeWPF/Controls/NumberBox.xaml.cs
@@ -456,6 +456,15 @@ namespace HandBrakeWPF.Controls
{
e.Handled = true;
}
+
+ if (e.Key == Key.Up)
+ {
+ this.IncrementNumber();
+ }
+ else if (e.Key == Key.Down)
+ {
+ this.DecrementNumber();
+ }
}
/// <summary>