summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Views
diff options
context:
space:
mode:
authorsr55 <[email protected]>2017-12-15 21:33:57 +0000
committersr55 <[email protected]>2017-12-15 21:33:57 +0000
commitadd6e2ac430652a96ff6fd1a72824796064e259f (patch)
tree9e4e40fc78df59bac9f9b36c33c24db33c37dd93 /win/CS/HandBrakeWPF/Views
parent5283a0a7e3200218b7074574f65d2f849a052edb (diff)
WinGui: Mouse Wheel can scroll previews.
Diffstat (limited to 'win/CS/HandBrakeWPF/Views')
-rw-r--r--win/CS/HandBrakeWPF/Views/StaticPreviewView.xaml6
-rw-r--r--win/CS/HandBrakeWPF/Views/StaticPreviewView.xaml.cs15
-rw-r--r--win/CS/HandBrakeWPF/Views/SummaryView.xaml3
-rw-r--r--win/CS/HandBrakeWPF/Views/SummaryView.xaml.cs15
4 files changed, 33 insertions, 6 deletions
diff --git a/win/CS/HandBrakeWPF/Views/StaticPreviewView.xaml b/win/CS/HandBrakeWPF/Views/StaticPreviewView.xaml
index 517ae13f9..c7eb5fb09 100644
--- a/win/CS/HandBrakeWPF/Views/StaticPreviewView.xaml
+++ b/win/CS/HandBrakeWPF/Views/StaticPreviewView.xaml
@@ -21,7 +21,7 @@
<TextBlock Text="No Preview Available" VerticalAlignment="Center" Padding="60,60,60,60" FontWeight="Bold" FontSize="25" Foreground="DarkGray" />
</StackPanel>
- <Image Source="{Binding PreviewImage}" MaxWidth="{Binding Width}" MaxHeight="{Binding Height}" />
+ <Image Source="{Binding PreviewImage}" MaxWidth="{Binding Width}" MaxHeight="{Binding Height}" MouseWheel="PreviewImage_OnMouseWheel" />
<Border BorderBrush="WhiteSmoke" BorderThickness="1,1,1,1" CornerRadius="8,8,8,8" Padding="8"
@@ -63,10 +63,6 @@
<ProgressBar MinHeight="5" Maximum="100" Minimum="0" Value="{Binding PercentageValue}" Grid.Column="0" Grid.ColumnSpan="2" />
<TextBlock Margin="5,0,0,0" Text="{Binding Percentage}" Grid.Column="2" HorizontalAlignment="Right" Foreground="White" />
</Grid>
-
-
-
-
</Grid>
</Border>
diff --git a/win/CS/HandBrakeWPF/Views/StaticPreviewView.xaml.cs b/win/CS/HandBrakeWPF/Views/StaticPreviewView.xaml.cs
index 8c2c55991..17ef64928 100644
--- a/win/CS/HandBrakeWPF/Views/StaticPreviewView.xaml.cs
+++ b/win/CS/HandBrakeWPF/Views/StaticPreviewView.xaml.cs
@@ -10,6 +10,9 @@
namespace HandBrakeWPF.Views
{
using System.Windows;
+ using System.Windows.Input;
+
+ using HandBrakeWPF.ViewModels.Interfaces;
/// <summary>
/// Interaction logic for StaticPreviewView.xaml
@@ -23,5 +26,17 @@ namespace HandBrakeWPF.Views
{
InitializeComponent();
}
+
+ private void PreviewImage_OnMouseWheel(object sender, MouseWheelEventArgs e)
+ {
+ if (e.Delta > 1)
+ {
+ ((IStaticPreviewViewModel)this.DataContext).NextPreview();
+ }
+ else
+ {
+ ((IStaticPreviewViewModel)this.DataContext).PreviousPreview();
+ }
+ }
}
}
diff --git a/win/CS/HandBrakeWPF/Views/SummaryView.xaml b/win/CS/HandBrakeWPF/Views/SummaryView.xaml
index e2d638554..cb3ed220b 100644
--- a/win/CS/HandBrakeWPF/Views/SummaryView.xaml
+++ b/win/CS/HandBrakeWPF/Views/SummaryView.xaml
@@ -118,7 +118,7 @@
</Grid.ColumnDefinitions>
<Image Source="{Binding PreviewImage}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="0,5,10,0" x:Name="previewImage" Panel.ZIndex="0" Grid.ColumnSpan="2"
- MaxWidth="{Binding MaxWidth}" MaxHeight="{Binding MaxHeight}" />
+ MaxWidth="{Binding MaxWidth}" MaxHeight="{Binding MaxHeight}" MouseWheel="PreviewImage_OnMouseWheel" />
<Border Grid.Row="1" Grid.ColumnSpan="2" VerticalAlignment="Bottom" HorizontalAlignment="Center" Background="Transparent" Margin="0,5,0,5">
<TextBlock Text="{Binding PreviewInfo}" TextAlignment="Center" Visibility="{Binding IsPreviewInfoVisible, Converter={StaticResource boolToVisConverter}}" />
@@ -129,6 +129,7 @@
<ColumnDefinition Width="42" />
<ColumnDefinition Width="42" />
</Grid.ColumnDefinitions>
+
<Border BorderThickness="1,1,1,1" CornerRadius="4,0,0,4" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Column="0" cal:Message.Attach="[Event MouseDown] = [Action PreviousPreview]"
Visibility="{Binding IsPreviousPreviewControlVisible,Converter={StaticResource boolToVisConverter}}"
Background="Black" Opacity="0.5" Margin="0,0,0,0" >
diff --git a/win/CS/HandBrakeWPF/Views/SummaryView.xaml.cs b/win/CS/HandBrakeWPF/Views/SummaryView.xaml.cs
index e3c35b48e..8c21fc3da 100644
--- a/win/CS/HandBrakeWPF/Views/SummaryView.xaml.cs
+++ b/win/CS/HandBrakeWPF/Views/SummaryView.xaml.cs
@@ -10,6 +10,9 @@
namespace HandBrakeWPF.Views
{
using System.Windows.Controls;
+ using System.Windows.Input;
+
+ using HandBrakeWPF.ViewModels.Interfaces;
/// <summary>
/// Interaction logic for SummaryView.xaml
@@ -20,5 +23,17 @@ namespace HandBrakeWPF.Views
{
this.InitializeComponent();
}
+
+ private void PreviewImage_OnMouseWheel(object sender, MouseWheelEventArgs e)
+ {
+ if (e.Delta > 1)
+ {
+ ((ISummaryViewModel)this.DataContext).NextPreview();
+ }
+ else
+ {
+ ((ISummaryViewModel)this.DataContext).PreviousPreview();
+ }
+ }
}
}