summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorsr55 <[email protected]>2017-08-26 21:03:04 +0100
committersr55 <[email protected]>2017-08-26 21:03:39 +0100
commit4fea60efbcc3108d72dd909048f1586f99f71ca4 (patch)
treeb1bcad8687b19d4306a8f00b72c95b720574c39e /win
parentf70d349fd71a373c19568d579c2aa12d24e62c22 (diff)
WinGui: Various improvements and fixes to the new summary tab. Revert tab order change. #833
Diffstat (limited to 'win')
-rw-r--r--win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs22
-rw-r--r--win/CS/HandBrakeWPF/Properties/ResourcesUI.resx8
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs73
-rw-r--r--win/CS/HandBrakeWPF/Views/MainView.xaml6
-rw-r--r--win/CS/HandBrakeWPF/Views/SummaryView.xaml82
-rw-r--r--win/CS/HandBrakeWPF/Views/SummaryView.xaml.cs14
6 files changed, 135 insertions, 70 deletions
diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs
index 802eae0b4..9cdce00b9 100644
--- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs
+++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs
@@ -19,7 +19,7 @@ namespace HandBrakeWPF.Properties {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class ResourcesUI {
@@ -817,7 +817,7 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
- /// Looks up a localized string similar to Picture.
+ /// Looks up a localized string similar to Dimensions.
/// </summary>
public static string MainView_PictureTab {
get {
@@ -2412,6 +2412,15 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to No Source.
+ /// </summary>
+ public static string SummaryView_NoSource {
+ get {
+ return ResourceManager.GetString("SummaryView_NoSource", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to No Subtitle Tracks.
/// </summary>
public static string SummaryView_NoSubtitleTracks {
@@ -2421,6 +2430,15 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to No Tracks.
+ /// </summary>
+ public static string SummaryView_NoTracks {
+ get {
+ return ResourceManager.GetString("SummaryView_NoTracks", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Preview {0} of {1}.
/// </summary>
public static string SummaryView_PreviewInfo {
diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx
index 27a3a055e..98b46afe9 100644
--- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx
+++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx
@@ -172,7 +172,7 @@
<value>Pause</value>
</data>
<data name="MainView_PictureTab" xml:space="preserve">
- <value>Picture</value>
+ <value>Dimensions</value>
</data>
<data name="MainView_Presets" xml:space="preserve">
<value>Presets</value>
@@ -971,4 +971,10 @@ This will not affect your current settings in the Subtitle tab.</value>
<data name="SummaryView_PreviewInfo" xml:space="preserve">
<value>Preview {0} of {1}</value>
</data>
+ <data name="SummaryView_NoSource" xml:space="preserve">
+ <value>No Source</value>
+ </data>
+ <data name="SummaryView_NoTracks" xml:space="preserve">
+ <value>No Tracks</value>
+ </data>
</root> \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs
index 10f53517f..a65fca5eb 100644
--- a/win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/SummaryViewModel.cs
@@ -17,6 +17,7 @@ namespace HandBrakeWPF.ViewModels
using System.Text;
using System.Windows.Media.Imaging;
+ using HandBrake.ApplicationServices.Interop;
using HandBrake.ApplicationServices.Interop.Model.Encoding;
using HandBrakeWPF.EventArgs;
@@ -44,6 +45,10 @@ namespace HandBrakeWPF.ViewModels
private bool isMkv;
private int selectedPreview = 2;
+ private bool isPreviousPreviewControlVisible;
+
+ private bool isNextPreviewControlVisible;
+
public SummaryViewModel(IScan scanService, IUserSettingService userSettingService)
{
this.scanService = scanService;
@@ -126,6 +131,8 @@ namespace HandBrakeWPF.ViewModels
public BitmapImage PreviewImage { get; set; }
public bool PreviewNotAvailable { get; set; }
+ public int MaxWidth { get; set; }
+ public int MaxHeight { get; set; }
public string VideoTrackInfo { get; set; }
public string AudioTrackInfo { get; set; }
@@ -136,11 +143,38 @@ namespace HandBrakeWPF.ViewModels
public string DimensionInfo { get; set; }
public string AspectInfo { get; set; }
- public bool IsPreviousPreviewControlVisible { get; set; } = false;
- public bool IsNextPreviewControlVisible { get; set; } = false;
- public bool IsPreviewInfoVisible { get; set; } = false;
+
+ public bool IsPreviewInfoVisible { get; set; }
public string PreviewInfo { get; set; }
+ public bool IsPreviousPreviewControlVisible
+ {
+ get
+ {
+ return this.isPreviousPreviewControlVisible;
+ }
+ set
+ {
+ if (value == this.isPreviousPreviewControlVisible) return;
+ this.isPreviousPreviewControlVisible = value;
+ this.NotifyOfPropertyChange(() => this.IsPreviousPreviewControlVisible);
+ }
+ }
+
+ public bool IsNextPreviewControlVisible
+ {
+ get
+ {
+ return this.isNextPreviewControlVisible;
+ }
+ set
+ {
+ if (value == this.isNextPreviewControlVisible) return;
+ this.isNextPreviewControlVisible = value;
+ this.NotifyOfPropertyChange(() => this.IsNextPreviewControlVisible);
+ }
+ }
+
#endregion
#region Task Properties
@@ -303,7 +337,6 @@ namespace HandBrakeWPF.ViewModels
if (this.selectedPreview == maxPreview)
{
this.IsNextPreviewControlVisible = false;
- this.NotifyOfPropertyChange(() => this.IsNextPreviewControlVisible);
}
}
@@ -318,7 +351,6 @@ namespace HandBrakeWPF.ViewModels
if (this.selectedPreview == 1)
{
this.IsPreviousPreviewControlVisible = false;
- this.NotifyOfPropertyChange(() => this.IsPreviousPreviewControlVisible);
}
}
@@ -341,9 +373,6 @@ namespace HandBrakeWPF.ViewModels
{
this.IsNextPreviewControlVisible = false;
}
-
- this.NotifyOfPropertyChange(() => this.IsPreviousPreviewControlVisible);
- this.NotifyOfPropertyChange(() => this.IsNextPreviewControlVisible);
}
#region Private Methods
@@ -477,7 +506,7 @@ namespace HandBrakeWPF.ViewModels
filters.Add(ResourcesUI.SummaryView_Rotation);
}
- return string.Join(", ", filters).Trim();
+ return string.Join(", ", filters).TrimEnd(',').Trim();
}
private string GetAudioDescription()
@@ -492,13 +521,17 @@ namespace HandBrakeWPF.ViewModels
if (this.Task.AudioTracks.Count >= 1)
{
AudioTrack track1 = this.Task.AudioTracks[0];
- desc.AppendLine(string.Format("{0}, {1}", EnumHelper<AudioEncoder>.GetDisplay(track1.Encoder), track1.MixDown));
+ HBMixdown mixdownName = HandBrakeEncoderHelpers.GetMixdown(track1.MixDown);
+ string mixdown = mixdownName != null ? ", " + mixdownName.DisplayName : string.Empty;
+ desc.AppendLine(string.Format("{0}{1}", EnumHelper<AudioEncoder>.GetDisplay(track1.Encoder), mixdown));
}
if (this.Task.AudioTracks.Count >= 2)
{
AudioTrack track2 = this.Task.AudioTracks[1];
- desc.AppendLine(string.Format("{0}, {1}", EnumHelper<AudioEncoder>.GetDisplay(track2.Encoder), track2.MixDown));
+ HBMixdown mixdownName = HandBrakeEncoderHelpers.GetMixdown(track2.MixDown);
+ string mixdown = mixdownName != null ? ", " + mixdownName.DisplayName : string.Empty;
+ desc.AppendLine(string.Format("{0}{1}", EnumHelper<AudioEncoder>.GetDisplay(track2.Encoder), mixdown));
}
if (this.Task.AudioTracks.Count > 2)
@@ -521,13 +554,17 @@ namespace HandBrakeWPF.ViewModels
if (this.Task.SubtitleTracks.Count >= 1)
{
SubtitleTrack track1 = this.Task.SubtitleTracks[0];
- desc.AppendLine(string.Format("{0}, {1}", track1.SourceTrack, track1.Burned ? ResourcesUI.SummaryView_Burned : string.Empty));
+ string subtitleName = track1.IsSrtSubtitle ? track1.SrtFileName : track1.SourceTrack.ToString();
+ string burned = track1.Burned ? ", " + ResourcesUI.SummaryView_Burned : string.Empty;
+ desc.AppendLine(string.Format("{0}{1}", subtitleName, burned));
}
if (this.Task.SubtitleTracks.Count >= 2)
{
SubtitleTrack track2 = this.Task.SubtitleTracks[1];
- desc.AppendLine(string.Format("{0}, {1}", track2.SourceTrack, track2.Burned ? ResourcesUI.SummaryView_Burned : string.Empty));
+ string subtitleName = track2.IsSrtSubtitle ? track2.SrtFileName : track2.SourceTrack.ToString();
+ string burned = track2.Burned ? ", " + ResourcesUI.SummaryView_Burned : string.Empty;
+ desc.AppendLine(string.Format("{0}{1}", subtitleName, burned));
}
if (this.Task.SubtitleTracks.Count > 2)
@@ -540,7 +577,7 @@ namespace HandBrakeWPF.ViewModels
private void ClearDisplay()
{
- this.VideoTrackInfo = string.Empty;
+ this.VideoTrackInfo = ResourcesUI.SummaryView_NoTracks;
this.NotifyOfPropertyChange(() => this.VideoTrackInfo);
this.AudioTrackInfo = string.Empty;
@@ -552,10 +589,10 @@ namespace HandBrakeWPF.ViewModels
this.ChapterInfo = string.Empty;
this.NotifyOfPropertyChange(() => this.ChapterInfo);
- this.FiltersInfo = string.Empty;
+ this.FiltersInfo = ResourcesUI.SummaryView_NoFilters;
this.NotifyOfPropertyChange(() => this.FiltersInfo);
- this.DimensionInfo = string.Empty;
+ this.DimensionInfo = ResourcesUI.SummaryView_NoSource;
this.NotifyOfPropertyChange(() => this.ChapterInfo);
this.AspectInfo = string.Empty;
@@ -595,9 +632,13 @@ namespace HandBrakeWPF.ViewModels
{
this.PreviewNotAvailable = false;
this.PreviewImage = image;
+ this.MaxWidth = (int)image.Width;
+ this.MaxHeight = (int)image.Height;
this.IsPreviewInfoVisible = true;
this.NotifyOfPropertyChange(() => this.IsPreviewInfoVisible);
this.NotifyOfPropertyChange(() => this.PreviewImage);
+ this.NotifyOfPropertyChange(() => this.MaxWidth);
+ this.NotifyOfPropertyChange(() => this.MaxHeight);
}
}
diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml
index 47c93c62e..cadd5a5ee 100644
--- a/win/CS/HandBrakeWPF/Views/MainView.xaml
+++ b/win/CS/HandBrakeWPF/Views/MainView.xaml
@@ -420,15 +420,15 @@
<TabItem Name="summaryTab" Header="{x:Static Properties:ResourcesUI.MainView_SummaryTab}">
<ContentControl x:Name="SummaryViewModel" />
</TabItem>
- <TabItem Name="videoTab" Header="{x:Static Properties:ResourcesUI.MainView_VideoTab}">
- <ContentControl x:Name="VideoViewModel" VerticalAlignment="Stretch" />
- </TabItem>
<TabItem Name="pictureTab" Header="{x:Static Properties:ResourcesUI.MainView_PictureTab}">
<ContentControl x:Name="PictureSettingsViewModel" />
</TabItem>
<TabItem Name="filtersTab" Header="{x:Static Properties:ResourcesUI.MainView_FiltersTab}">
<ContentControl x:Name="FiltersViewModel" />
</TabItem>
+ <TabItem Name="videoTab" Header="{x:Static Properties:ResourcesUI.MainView_VideoTab}">
+ <ContentControl x:Name="VideoViewModel" VerticalAlignment="Stretch" />
+ </TabItem>
<TabItem Name="audioTab" Header="{x:Static Properties:ResourcesUI.MainView_AudioTab}">
<ContentControl x:Name="AudioViewModel" />
</TabItem>
diff --git a/win/CS/HandBrakeWPF/Views/SummaryView.xaml b/win/CS/HandBrakeWPF/Views/SummaryView.xaml
index 59a0ce04b..fb3d97892 100644
--- a/win/CS/HandBrakeWPF/Views/SummaryView.xaml
+++ b/win/CS/HandBrakeWPF/Views/SummaryView.xaml
@@ -14,19 +14,14 @@
<converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
</UserControl.Resources>
- <Grid Margin="5,5,0,0">
+ <Grid Margin="10,5,0,5">
<Grid.ColumnDefinitions>
- <ColumnDefinition Width="4*" />
- <ColumnDefinition Width="5*" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
-
<!-- Column 1 -->
-
- <Grid Margin="5,0,0,0" Grid.Column="0" >
+ <Grid Grid.Column="0" MinWidth="325" MaxWidth="400" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="75" />
<ColumnDefinition Width="*" />
@@ -59,8 +54,8 @@
<TextBlock Text="Format:" FontSize="14" FontFamily="Sergio Light" Grid.Row="0" VerticalAlignment="Center" />
- <ComboBox Name="Container" Width="100" HorizontalAlignment="Left" Margin="0,2,0,5" Grid.Row="0" Grid.Column="1"
- ToolTip="{x:Static Properties:ResourcesTooltips.MainView_Mux}"
+ <ComboBox Name="Container" Width="100" HorizontalAlignment="Left" Grid.Row="0" Grid.Column="1"
+ ToolTip="{x:Static Properties:ResourcesTooltips.MainView_Mux}" VerticalAlignment="Center"
ItemsSource="{Binding OutputFormats, Converter={StaticResource enumComboConverter}}"
SelectedItem="{Binding SelectedOutputFormat, Converter={StaticResource enumComboConverter}}" />
<CheckBox Name="WebOptimized" VerticalAlignment="Center" Grid.Row="1" Grid.Column="1"
@@ -81,8 +76,8 @@
<TextBlock Text="Tracks:" FontSize="14" FontFamily="Sergio Light" Grid.Row="5" Grid.Column="0" VerticalAlignment="Center" />
<TextBlock Text="{Binding VideoTrackInfo}" Grid.Row="5" Grid.Column="1" VerticalAlignment="Center" />
- <TextBlock Text="{Binding AudioTrackInfo}" Grid.Row="6" Grid.Column="1" />
- <TextBlock Text="{Binding SubtitleTrackInfo}" Grid.Row="7" Grid.Column="1" />
+ <TextBlock Text="{Binding AudioTrackInfo}" Grid.Row="6" Grid.Column="1" TextWrapping="Wrap" />
+ <TextBlock Text="{Binding SubtitleTrackInfo}" Grid.Row="7" Grid.Column="1" TextWrapping="Wrap" />
<TextBlock Text="{Binding ChapterInfo}" Grid.Row="8" Grid.Column="1" />
<TextBlock Text="Filters:" FontSize="14" FontFamily="Sergio Light" Grid.Row="10" Grid.Column="0" VerticalAlignment="Center" />
@@ -90,61 +85,52 @@
</Grid>
<!-- Column 2 -->
-
- <Grid Grid.Column="1">
+ <Grid Grid.Column="1" Margin="10,0,0,5">
<Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
-
- <Grid>
- <Image Source="{Binding PreviewImage}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="10,5,10,0" x:Name="previewImage" MouseMove="PreviewImage_OnMouseMove" Panel.ZIndex="0" />
- <Border BorderThickness="1,1,1,1" CornerRadius="8,8,8,8" VerticalAlignment="Center" HorizontalAlignment="Left" Panel.ZIndex="1" cal:Message.Attach="[Event MouseDown] = [Action PreviousPreview]"
+ <Grid Grid.Row="0" Grid.ColumnSpan="2" HorizontalAlignment="Left" VerticalAlignment="Top">
+
+ <Grid.RowDefinitions>
+ <RowDefinition Height="*" />
+ <RowDefinition Height="Auto" MinHeight="26" />
+ <RowDefinition Height="Auto" MinHeight="26" />
+ </Grid.RowDefinitions>
+
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="*" />
+ </Grid.ColumnDefinitions>
+
+ <Image Source="{Binding PreviewImage}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="0,5,10,0" x:Name="previewImage" MouseMove="PreviewImage_OnMouseMove" MouseLeave="PreviewImage_OnMouseLeave" Panel.ZIndex="0" Grid.ColumnSpan="2"
+ MaxWidth="{Binding MaxWidth}" MaxHeight="{Binding MaxHeight}" />
+
+ <Border BorderThickness="1,1,1,1" CornerRadius="8,8,8,8" VerticalAlignment="Center" HorizontalAlignment="Left" Panel.ZIndex="1" cal:Message.Attach="[Event MouseDown] = [Action PreviousPreview]" Grid.ColumnSpan="2"
Background="Black" Opacity="0.75" Margin="20,0,0,0" Visibility="{Binding IsPreviousPreviewControlVisible, Converter={StaticResource boolToVisConverter}}" >
<TextBlock Text="&lt;" FontSize="30" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" Padding="8,3" Margin="0" />
</Border>
- <Border BorderThickness="1,1,1,1" CornerRadius="8,8,8,8" VerticalAlignment="Center" HorizontalAlignment="Right" Panel.ZIndex="1" cal:Message.Attach="[Event MouseDown] = [Action NextPreview]"
+ <Border BorderThickness="1,1,1,1" CornerRadius="8,8,8,8" VerticalAlignment="Center" HorizontalAlignment="Right" Panel.ZIndex="1" cal:Message.Attach="[Event MouseDown] = [Action NextPreview]" Grid.ColumnSpan="2"
Background="Black" Opacity="0.75" Margin="0,0,20,0" Visibility="{Binding IsNextPreviewControlVisible, Converter={StaticResource boolToVisConverter}}">
- <TextBlock Text="&gt;" FontSize="30" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" Padding="8,3" Margin="0" />
+ <TextBlock Text="&gt;" FontSize="30" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" Padding="8,3" Margin="0" />
</Border>
- <Border BorderThickness="1,1,1,1" CornerRadius="8,8,8,8" VerticalAlignment="Bottom" HorizontalAlignment="Center"
+ <Border BorderThickness="1,1,1,1" CornerRadius="8,8,8,8" VerticalAlignment="Bottom" HorizontalAlignment="Center" Grid.ColumnSpan="2"
Background="Black" Opacity="0.75" Margin="0,5,0,10">
<TextBlock Text="{Binding PreviewInfo}" FontSize="14" Foreground="White" Padding="8,3" Visibility="{Binding IsPreviewInfoVisible, Converter={StaticResource boolToVisConverter}}" />
</Border>
- </Grid>
-
-
- <Grid Margin="10,5,0,0" Grid.Row="1">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="85" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
-
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <Grid.Resources>
- <Style TargetType="TextBlock">
- <Setter Property="Margin" Value="0,0,0,0" />
- <Setter Property="Padding" Value="3" />
- </Style>
- </Grid.Resources>
+ <TextBlock Text="Dimensions:" FontSize="14" FontFamily="Sergio Light" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" />
+ <TextBlock Text="{Binding DimensionInfo}" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Row="1" Grid.Column="1" Margin="5,0,0,0" />
- <TextBlock Text="Dimensions:" FontSize="14" FontFamily="Sergio Light" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" />
- <TextBlock Text="{Binding DimensionInfo}" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Row="0" Grid.Column="1" />
+ <TextBlock Text="Aspect:" FontSize="14" FontFamily="Sergio Light" Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" Visibility="Collapsed" />
+ <TextBlock Text="{Binding AspectInfo}" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Row="2" Grid.Column="1" Margin="5,0,0,0" Visibility="Collapsed" />
- <TextBlock Text="Aspect:" FontSize="14" FontFamily="Sergio Light" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" Visibility="Collapsed" />
- <TextBlock Text="{Binding AspectInfo}" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Row="1" Grid.Column="1" Visibility="Collapsed" />
</Grid>
</Grid>
diff --git a/win/CS/HandBrakeWPF/Views/SummaryView.xaml.cs b/win/CS/HandBrakeWPF/Views/SummaryView.xaml.cs
index 744003698..5b0354576 100644
--- a/win/CS/HandBrakeWPF/Views/SummaryView.xaml.cs
+++ b/win/CS/HandBrakeWPF/Views/SummaryView.xaml.cs
@@ -11,6 +11,7 @@ namespace HandBrakeWPF.Views
{
using System.Windows.Controls;
using System.Windows.Input;
+ using System.Windows.Media;
using HandBrakeWPF.ViewModels.Interfaces;
@@ -42,5 +43,18 @@ namespace HandBrakeWPF.Views
((ISummaryViewModel)this.DataContext).SetPreviewControlVisibility(leftHalf, rightHalf);
}
}
+
+ private void PreviewImage_OnMouseLeave(object sender, MouseEventArgs e)
+ {
+ HitTestResult result = VisualTreeHelper.HitTest(this.previewImage, e.GetPosition(this.previewImage));
+
+ if (result != null && result.VisualHit.GetType() == typeof(Image))
+ {
+ e.Handled = true;
+ return;
+ }
+
+ ((ISummaryViewModel)this.DataContext).SetPreviewControlVisibility(false, false);
+ }
}
}