diff options
author | sr55 <[email protected]> | 2016-12-10 20:57:18 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2016-12-10 20:57:18 +0000 |
commit | 5fad4b45d7dfee9ac086ee20b08509d3d1c9f315 (patch) | |
tree | e178615a8cf9f0c26f3837b7e814d24cbfca3a2f /win/CS | |
parent | 81f0ddb2ffbe50901a6825aa932036ebb7ee4d47 (diff) |
WinGui: Further fixes to handle the new "Automatic" anamorphic.. This should fix the case where Selecting a downscaled preset, then selecting a non downscaled preset would result in the Height not being recalculated. For now I've also disabled "Custom" anamorphic as it's quite badly broken until it can be re-worked. Fixes #415
Diffstat (limited to 'win/CS')
-rw-r--r-- | win/CS/HandBrakeWPF/Properties/Resources.Designer.cs | 2 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Properties/Resources.resx | 2 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs | 27 |
3 files changed, 18 insertions, 13 deletions
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs index b692aa83f..2fe0cec2e 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs @@ -1249,7 +1249,7 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
- /// Looks up a localized string similar to Storage: {0}x{1}, Display: {2}x{3}.
+ /// Looks up a localized string similar to Display Size: {0}x{1}, PAR {2}x{3}.
/// </summary>
public static string PictureSettingsViewModel_StorageDisplayLabel {
get {
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx index 6791f06e6..b1b496c7d 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.resx +++ b/win/CS/HandBrakeWPF/Properties/Resources.resx @@ -618,7 +618,7 @@ The Activity log may have further information.</value> <value>Update Failed. You can try downloading the update from https://handbrake.fr</value>
</data>
<data name="PictureSettingsViewModel_StorageDisplayLabel" xml:space="preserve">
- <value>Storage: {0}x{1}, Display: {2}x{3}</value>
+ <value>Display Size: {0}x{1}, PAR {2}x{3}</value>
</data>
<data name="QueueSelectionViewModel_AddToQueue" xml:space="preserve">
<value>Add to Queue</value>
diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs index e44c0d9d1..35260356f 100644 --- a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs @@ -146,7 +146,7 @@ namespace HandBrakeWPF.ViewModels {
get
{
- return new List<Anamorphic> { Anamorphic.None, Anamorphic.Automatic, Anamorphic.Loose, Anamorphic.Custom };
+ return new List<Anamorphic> { Anamorphic.None, Anamorphic.Automatic, Anamorphic.Loose }; // , Anamorphic.Custom TODO Re-enable one the UI is re-worked.
}
}
@@ -643,15 +643,20 @@ namespace HandBrakeWPF.ViewModels }
// Set the width, then check the height doesn't breach the max height and correct if necessary.
- int width = this.GetModulusValue(this.GetRes((this.sourceResolution.Width - this.CropLeft - this.CropRight), preset.Task.MaxWidth));
- this.Width = width;
-
- // If we have a max height, make sure we havn't breached it.
+ int width = this.GetModulusValue(this.GetRes((this.sourceResolution.Width - this.CropLeft - this.CropRight), preset.Task.MaxWidth));
int height = this.GetModulusValue(this.GetRes((this.sourceResolution.Height - this.CropTop - this.CropBottom), preset.Task.MaxHeight));
- if (preset.Task.MaxHeight.HasValue && this.Height > preset.Task.MaxHeight.Value)
- {
- this.Height = height;
- }
+
+ // Set the backing fields to avoid triggering recalulation until both are set.
+ this.Task.Width = width;
+ this.Task.Height = height;
+
+ // Trigger a Recalc
+ this.RecaulcatePictureSettingsProperties(ChangedPictureField.Width);
+
+ // Update the UI
+ this.NotifyOfPropertyChange(() => this.Width);
+ this.NotifyOfPropertyChange(() => this.Height);
+
break;
case PresetPictureSettingsMode.None:
// Do Nothing except reset the Max Width/Height
@@ -936,7 +941,7 @@ namespace HandBrakeWPF.ViewModels double dispWidth = Math.Round((result.OutputWidth * result.OutputParWidth / result.OutputParHeight), 0);
this.DisplaySize = this.sourceResolution == null || this.sourceResolution.IsEmpty
? string.Empty
- : string.Format(Resources.PictureSettingsViewModel_StorageDisplayLabel, result.OutputWidth, result.OutputHeight, dispWidth, result.OutputHeight);
+ : string.Format(Resources.PictureSettingsViewModel_StorageDisplayLabel, dispWidth, result.OutputHeight, this.ParWidth, this.ParHeight);
// Step 4, Force an update on all the UI elements.
this.NotifyOfPropertyChange(() => this.Width);
@@ -979,7 +984,7 @@ namespace HandBrakeWPF.ViewModels this.WidthControlEnabled = true;
this.HeightControlEnabled = true;
this.ShowCustomAnamorphicControls = false;
- this.ShowModulus = false;
+ this.ShowModulus = true;
this.ShowKeepAR = false;
break;
|