From ffa1a048c75be90797b9c98a8d62a5fc8b03326b Mon Sep 17 00:00:00 2001 From: sr55 Date: Wed, 23 Aug 2017 22:32:28 +0100 Subject: WinGui: Summary Tab - Make the preview controls operational. #833 --- win/CS/HandBrakeWPF/Views/SummaryView.xaml.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'win/CS/HandBrakeWPF/Views/SummaryView.xaml.cs') diff --git a/win/CS/HandBrakeWPF/Views/SummaryView.xaml.cs b/win/CS/HandBrakeWPF/Views/SummaryView.xaml.cs index e3c35b48e..744003698 100644 --- a/win/CS/HandBrakeWPF/Views/SummaryView.xaml.cs +++ b/win/CS/HandBrakeWPF/Views/SummaryView.xaml.cs @@ -10,6 +10,12 @@ namespace HandBrakeWPF.Views { using System.Windows.Controls; + using System.Windows.Input; + + using HandBrakeWPF.ViewModels.Interfaces; + + using Image = System.Windows.Controls.Image; + using Point = System.Windows.Point; /// /// Interaction logic for SummaryView.xaml @@ -20,5 +26,21 @@ namespace HandBrakeWPF.Views { this.InitializeComponent(); } + + private void PreviewImage_OnMouseMove(object sender, MouseEventArgs e) + { + Image image = sender as Image; + + if (image != null && image.ActualWidth > 0) + { + Point p = Mouse.GetPosition(image); + double width = image.ActualWidth / 2; + + bool leftHalf = p.X <= width; + bool rightHalf = p.X > width; + + ((ISummaryViewModel)this.DataContext).SetPreviewControlVisibility(leftHalf, rightHalf); + } + } } } -- cgit v1.2.3