summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels
diff options
context:
space:
mode:
authorsr55 <[email protected]>2014-05-17 21:27:20 +0000
committersr55 <[email protected]>2014-05-17 21:27:20 +0000
commit24203717648fcdeff506ac6aea100d746f7b487c (patch)
treee6240daa249007ce287f201804398c09e17b5f1e /win/CS/HandBrakeWPF/ViewModels
parent921c659de321eedb3784105652bccce511867e1a (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')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs2
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs37
2 files changed, 38 insertions, 1 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
index c051b0aad..b10c0f292 100644
--- a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
@@ -1049,7 +1049,7 @@ namespace HandBrakeWPF.ViewModels
double dispWidth = Math.Round((result.OutputWidth * result.OutputParWidth / result.OutputParHeight), 0);
this.DisplaySize = this.sourceResolution.IsEmpty
- ? string.Empty
+ ? string.Format(Properties.Resources.PictureSettings_OutputResolution, "None")
: string.Format("Output: {0}x{1}, Anamorphic: {2}x{3}", result.OutputWidth, result.OutputHeight, dispWidth, result.OutputHeight);
}
else
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