diff options
author | sr55 <[email protected]> | 2018-05-16 21:35:44 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2018-05-16 21:35:44 +0100 |
commit | 2054a421455b52ca060767c8cd544b16caacab96 (patch) | |
tree | 72fceff4143d0704a4f1bce19aa75a3b996bd845 /win/CS/HandBrakeWPF | |
parent | 70151214eea4fa98eedbf796a6c749d14bf4909d (diff) |
WinGui: Improved behaviour of the Add Selection to Queue Window. Can now be resized to full screen and also now supports spacebar selection once a record is selected to toggle the selection checkbox. Fixes #1341
Diffstat (limited to 'win/CS/HandBrakeWPF')
-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;
+ }
+ }
+ }
}
}
|