diff options
author | sr55 <[email protected]> | 2019-04-19 22:43:30 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2019-04-19 22:43:30 +0100 |
commit | 1e36c4f811d52996c970236039a94060e1a81e8d (patch) | |
tree | f5e82b39b7675d6cdc5758f7016841746bccc79e /win/CS/HandBrakeWPF/Views | |
parent | c2448cadbf0865578131c1f9518610e4f7a1d9dc (diff) |
WinGui: Make the Queue Delete button more reliable. Doesn't need a double click now for first use.
Diffstat (limited to 'win/CS/HandBrakeWPF/Views')
-rw-r--r-- | win/CS/HandBrakeWPF/Views/QueueView.xaml | 19 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/QueueView.xaml.cs | 11 |
2 files changed, 18 insertions, 12 deletions
diff --git a/win/CS/HandBrakeWPF/Views/QueueView.xaml b/win/CS/HandBrakeWPF/Views/QueueView.xaml index c6f9dd93f..94af3982e 100644 --- a/win/CS/HandBrakeWPF/Views/QueueView.xaml +++ b/win/CS/HandBrakeWPF/Views/QueueView.xaml @@ -138,7 +138,6 @@ </Grid>
<ListBox Tag="{Binding}" x:Name="queueJobs" Grid.Row="1" Margin="10,0,5,0"
-
dd:DragDrop.DropHandler="{Binding}"
dd:DragDrop.IsDragSource="True"
dd:DragDrop.IsDropTarget="True"
@@ -266,16 +265,14 @@ Value="{Binding DataContext.ProgressValue, ElementName=queueJobs}" IsIndeterminate="{Binding DataContext.IntermediateProgress, ElementName=queueJobs}"
Visibility="{Binding ShowEncodeProgress, Converter={StaticResource boolToVisConverter}}" />
- <Image Source="Images\close64.png" Width="16" Height="16" Grid.Row="0" Grid.Column="1" Grid.RowSpan="3"
- VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,0,0,0" >
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="MouseLeftButtonDown">
- <cal:ActionMessage MethodName="RemoveJob">
- <cal:Parameter Value="{Binding}" />
- </cal:ActionMessage>
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </Image>
+ <Button Grid.Row="0" Grid.Column="1" Grid.RowSpan="3" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,0,0,0" Click="QueueDeleteJob_OnClick"
+ AutomationProperties.Name="{x:Static Properties:ResourcesTooltips.QueueView_DeleteJob}" ToolTip="{x:Static Properties:ResourcesTooltips.QueueView_DeleteJob}" >
+ <Button.Template>
+ <ControlTemplate>
+ <Image Width="16" Height="16" VerticalAlignment="Center" Source="Images/close64.png" />
+ </ControlTemplate>
+ </Button.Template>
+ </Button>
</Grid>
</Grid>
</DataTemplate>
diff --git a/win/CS/HandBrakeWPF/Views/QueueView.xaml.cs b/win/CS/HandBrakeWPF/Views/QueueView.xaml.cs index fbc94a7c6..aed7faf36 100644 --- a/win/CS/HandBrakeWPF/Views/QueueView.xaml.cs +++ b/win/CS/HandBrakeWPF/Views/QueueView.xaml.cs @@ -168,6 +168,15 @@ namespace HandBrakeWPF.Views {
((QueueViewModel)this.DataContext).EditJob(this.mouseActiveQueueTask);
}
-
+
+ private void QueueDeleteJob_OnClick(object sender, RoutedEventArgs e)
+ {
+ Button button = sender as Button;
+ QueueTask task = button?.DataContext as QueueTask;
+ if (task != null)
+ {
+ ((QueueViewModel)this.DataContext).RemoveJob(task);
+ }
+ }
}
}
|