]> granicus.if.org Git - handbrake/commitdiff
WinGui: Further fixes to handle the new "Automatic" anamorphic.. This should fix...
authorsr55 <sr55.hb@outlook.com>
Sat, 10 Dec 2016 20:57:18 +0000 (20:57 +0000)
committersr55 <sr55.hb@outlook.com>
Sat, 10 Dec 2016 20:57:18 +0000 (20:57 +0000)
win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
win/CS/HandBrakeWPF/Properties/Resources.resx
win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs

index b692aa83f7a24b41e855d98a3df38af3b170d52f..2fe0cec2ee74dd8217f18af360dadcb6c9acd217 100644 (file)
@@ -1249,7 +1249,7 @@ namespace HandBrakeWPF.Properties {
         }\r
         \r
         /// <summary>\r
-        ///   Looks up a localized string similar to Storage: {0}x{1}, Display: {2}x{3}.\r
+        ///   Looks up a localized string similar to Display Size: {0}x{1},  PAR {2}x{3}.\r
         /// </summary>\r
         public static string PictureSettingsViewModel_StorageDisplayLabel {\r
             get {\r
index 6791f06e6764bb1ecd23852f5d73f2020e1c9315..b1b496c7df6dd89b9fec0912c5baaa5f5ac11e4b 100644 (file)
@@ -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>\r
   </data>\r
   <data name="PictureSettingsViewModel_StorageDisplayLabel" xml:space="preserve">\r
-    <value>Storage: {0}x{1}, Display: {2}x{3}</value>\r
+    <value>Display Size: {0}x{1},  PAR {2}x{3}</value>\r
   </data>\r
   <data name="QueueSelectionViewModel_AddToQueue" xml:space="preserve">\r
     <value>Add to Queue</value>\r
index e44c0d9d167b723c26303747b934493aba2fd0ae..35260356fea684b5f66cde947addb426fb243937 100644 (file)
@@ -146,7 +146,7 @@ namespace HandBrakeWPF.ViewModels
         {\r
             get\r
             {\r
-                return new List<Anamorphic> { Anamorphic.None, Anamorphic.Automatic, Anamorphic.Loose, Anamorphic.Custom };\r
+                return new List<Anamorphic> { Anamorphic.None, Anamorphic.Automatic, Anamorphic.Loose }; // , Anamorphic.Custom   TODO Re-enable one the UI is re-worked.\r
             }\r
         }\r
 \r
@@ -643,15 +643,20 @@ namespace HandBrakeWPF.ViewModels
                     }             \r
 \r
                     // Set the width, then check the height doesn't breach the max height and correct if necessary.\r
-                    int width = this.GetModulusValue(this.GetRes((this.sourceResolution.Width - this.CropLeft - this.CropRight), preset.Task.MaxWidth)); \r
-                    this.Width = width;\r
-\r
-                    // If we have a max height, make sure we havn't breached it.\r
+                    int width = this.GetModulusValue(this.GetRes((this.sourceResolution.Width - this.CropLeft - this.CropRight), preset.Task.MaxWidth));\r
                     int height = this.GetModulusValue(this.GetRes((this.sourceResolution.Height - this.CropTop - this.CropBottom), preset.Task.MaxHeight));\r
-                    if (preset.Task.MaxHeight.HasValue && this.Height > preset.Task.MaxHeight.Value)\r
-                    {\r
-                        this.Height = height;\r
-                    }\r
+\r
+                    // Set the backing fields to avoid triggering recalulation until both are set.\r
+                    this.Task.Width = width;\r
+                    this.Task.Height = height;\r
+\r
+                    // Trigger a Recalc\r
+                    this.RecaulcatePictureSettingsProperties(ChangedPictureField.Width);\r
+\r
+                    // Update the UI\r
+                    this.NotifyOfPropertyChange(() => this.Width);\r
+                    this.NotifyOfPropertyChange(() => this.Height);\r
+\r
                     break;\r
                 case PresetPictureSettingsMode.None:\r
                     // Do Nothing except reset the Max Width/Height\r
@@ -936,7 +941,7 @@ namespace HandBrakeWPF.ViewModels
             double dispWidth = Math.Round((result.OutputWidth * result.OutputParWidth / result.OutputParHeight), 0);\r
             this.DisplaySize = this.sourceResolution == null || this.sourceResolution.IsEmpty\r
                            ? string.Empty\r
-                           : string.Format(Resources.PictureSettingsViewModel_StorageDisplayLabel, result.OutputWidth, result.OutputHeight, dispWidth, result.OutputHeight);\r
+                           : string.Format(Resources.PictureSettingsViewModel_StorageDisplayLabel, dispWidth, result.OutputHeight, this.ParWidth, this.ParHeight);\r
 \r
             // Step 4, Force an update on all the UI elements.\r
             this.NotifyOfPropertyChange(() => this.Width);\r
@@ -979,7 +984,7 @@ namespace HandBrakeWPF.ViewModels
                     this.WidthControlEnabled = true;\r
                     this.HeightControlEnabled = true;\r
                     this.ShowCustomAnamorphicControls = false;\r
-                    this.ShowModulus = false;\r
+                    this.ShowModulus = true;\r
                     this.ShowKeepAR = false;\r
                     break;\r
 \r