diff options
author | sr55 <[email protected]> | 2018-04-29 15:09:09 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2018-04-29 15:09:09 +0100 |
commit | 015b88f86f67782d2c0d6c2e8d978b3d93a9b600 (patch) | |
tree | 3a3eca9cc0ccbffb2ce994d19f032e326bfb2281 /win/CS | |
parent | 7a49ab6e54a1fe6f33cf1e1ccbf46c8dd59015d1 (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/CS')
-rw-r--r-- | win/CS/HandBrakeWPF/Controls/NumberBox.xaml | 4 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Controls/NumberBox.xaml.cs | 9 |
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>
|