diff options
-rw-r--r-- | win/CS/HandBrakeWPF/Views/QueueSelectionView.xaml | 8 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/QueueSelectionView.xaml.cs | 15 |
2 files changed, 19 insertions, 4 deletions
diff --git a/win/CS/HandBrakeWPF/Views/QueueSelectionView.xaml b/win/CS/HandBrakeWPF/Views/QueueSelectionView.xaml index bd1e9bce5..d6446e1db 100644 --- a/win/CS/HandBrakeWPF/Views/QueueSelectionView.xaml +++ b/win/CS/HandBrakeWPF/Views/QueueSelectionView.xaml @@ -7,10 +7,10 @@ xmlns:Conveters="clr-namespace:HandBrakeWPF.Converters"
xmlns:Properties="clr-namespace:HandBrakeWPF.Properties"
Title="{Binding Title}"
+ MinWidth="550"
Width="550"
Height="475"
MinHeight="475"
- SizeToContent="Height"
WindowStartupLocation="CenterScreen"
TextOptions.TextFormattingMode="Display"
mc:Ignorable="d">
@@ -44,14 +44,14 @@ </StackPanel>
<!-- Selection -->
- <ListBox Grid.Row="2"
+ <ListBox x:Name="SelectionGrid" Grid.Row="2"
MinHeight="240"
- MaxHeight="500"
Margin="10,10,10,10"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
ItemsSource="{Binding TitleList}"
- SelectionMode="Single">
+ SelectionMode="Single"
+ PreviewKeyDown="SelectionGrid_OnKeyDown">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
diff --git a/win/CS/HandBrakeWPF/Views/QueueSelectionView.xaml.cs b/win/CS/HandBrakeWPF/Views/QueueSelectionView.xaml.cs index 553c7201f..dd0ee00d4 100644 --- a/win/CS/HandBrakeWPF/Views/QueueSelectionView.xaml.cs +++ b/win/CS/HandBrakeWPF/Views/QueueSelectionView.xaml.cs @@ -10,6 +10,9 @@ namespace HandBrakeWPF.Views
{
using System.Windows;
+ using System.Windows.Input;
+
+ using HandBrakeWPF.Model;
/// <summary>
/// Interaction logic for QueueSelectionView.xaml
@@ -23,5 +26,17 @@ namespace HandBrakeWPF.Views {
InitializeComponent();
}
+
+ private void SelectionGrid_OnKeyDown(object sender, KeyEventArgs e)
+ {
+ if (e.Key == Key.Space && this.SelectionGrid.SelectedItems.Count == 1)
+ {
+ SelectionTitle title = this.SelectionGrid.SelectedItems[0] as SelectionTitle;
+ if (title != null)
+ {
+ title.IsSelected = !title.IsSelected;
+ }
+ }
+ }
}
}
|