diff options
author | sr55 <[email protected]> | 2014-05-17 21:27:20 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2014-05-17 21:27:20 +0000 |
commit | 24203717648fcdeff506ac6aea100d746f7b487c (patch) | |
tree | e6240daa249007ce287f201804398c09e17b5f1e /win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs | |
parent | 921c659de321eedb3784105652bccce511867e1a (diff) |
WinGui: Give the preview window a presence on the picture settings tab. Added some initial code to manage the window size. (Note, this is not complete or DPI aware yet)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6197 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs index fd683fc2a..279cc6fc8 100644 --- a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs @@ -10,6 +10,7 @@ namespace HandBrakeWPF.ViewModels
{
using System;
+ using System.Windows;
using System.Windows.Media.Imaging;
using HandBrake.ApplicationServices.Model;
@@ -22,6 +23,12 @@ namespace HandBrakeWPF.ViewModels /// </summary>
public class StaticPreviewViewModel : ViewModelBase, IStaticPreviewViewModel
{
+ /*
+ * TODO
+ * - Screen needs to be made DPI Aware
+ * - Integrate Video Preview panel.
+ */
+
#region Fields
/// <summary>
@@ -63,6 +70,7 @@ namespace HandBrakeWPF.ViewModels {
this.scanService = scanService;
this.selectedPreviewImage = 1;
+ this.Title = Properties.Resources.Preview;
}
#endregion
@@ -172,11 +180,18 @@ namespace HandBrakeWPF.ViewModels #region Public Methods and Operators
+ /// <summary>
+ /// The update preview frame.
+ /// </summary>
+ /// <param name="task">
+ /// The task.
+ /// </param>
public void UpdatePreviewFrame(EncodeTask task)
{
this.Task = task;
this.UpdatePreviewFrame();
this.DisplayName = "Picture Preview";
+ this.Title = Properties.Resources.Preview;
}
/// <summary>
@@ -193,6 +208,28 @@ namespace HandBrakeWPF.ViewModels this.PreviewImage = image;
}
}
+
+ /// <summary>
+ /// The preview size changed.
+ /// </summary>
+ /// <param name="ea">
+ /// The ea.
+ /// </param>
+ public void PreviewSizeChanged(SizeChangedEventArgs ea)
+ {
+ Rect workArea = SystemParameters.WorkArea;
+ if (ea.NewSize.Width > workArea.Width)
+ {
+ this.Width = (int)Math.Round(workArea.Width, 0) - 20;
+ this.Title = Properties.Resources.Preview_Scaled;
+ }
+
+ if (ea.NewSize.Height > workArea.Height)
+ {
+ this.Height = (int)Math.Round(workArea.Height, 0) - 20;
+ this.Title = Properties.Resources.Preview_Scaled;
+ }
+ }
#endregion
}
}
\ No newline at end of file |