From d917bc2ad4fa1e2c12828f0e234a32cd19f682c1 Mon Sep 17 00:00:00 2001 From: sr55 Date: Fri, 11 Jan 2013 22:50:48 +0000 Subject: WinGui: Some Layout improvements to the Advanced tab to make it clearer what section the options come under. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5167 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- .../HandBrakeWPF/ViewModels/AdvancedViewModel.cs | 55 ++--- win/CS/HandBrakeWPF/Views/AdvancedView.xaml | 273 +++++++++------------ win/CS/HandBrakeWPF/Views/ShellView.xaml | 4 +- 3 files changed, 147 insertions(+), 185 deletions(-) (limited to 'win/CS') diff --git a/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs index 29b4bed48..741f31876 100644 --- a/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs @@ -98,7 +98,7 @@ namespace HandBrakeWPF.ViewModels /// /// The motion estimation range. /// - private AdvancedChoice motionEstimationRange; + private int motionEstimationRange; /// /// The no dct decimate. @@ -418,7 +418,13 @@ namespace HandBrakeWPF.ViewModels { this.motionEstimationMethod = value; this.NotifyOfPropertyChange(() => this.MotionEstimationMethod); - this.NotifyOfPropertyChange(() => this.MotionEstimationRangeVisible); + + if ((MotionEstimationMethod.Value == "hex" || MotionEstimationMethod.Value == "dia") && (motionEstimationRange > 16)) + { + this.motionEstimationRange = 16; + this.NotifyOfPropertyChange(() => this.MotionEstimationRange); + } + this.UpdateOptionsString(); } } @@ -426,7 +432,7 @@ namespace HandBrakeWPF.ViewModels /// /// Gets or sets MotionEstimationRange. /// - public AdvancedChoice MotionEstimationRange + public int MotionEstimationRange { get { @@ -435,24 +441,24 @@ namespace HandBrakeWPF.ViewModels set { - this.motionEstimationRange = value; + if ((MotionEstimationMethod.Value == "hex" || MotionEstimationMethod.Value == "dia") && (value > 16)) + { + this.motionEstimationRange = 16; + } + else if (value < 4) + { + this.motionEstimationRange = 4; + } + else + { + this.motionEstimationRange = value; + } + this.NotifyOfPropertyChange(() => this.MotionEstimationRange); this.UpdateOptionsString(); } } - /// - /// Gets a value indicating whether MotionEstimationRangeVisible. - /// - public bool MotionEstimationRangeVisible - { - get - { - string motionMethod = this.MotionEstimationMethod.Value; - return motionMethod == "umh" || motionMethod == "esa" || motionMethod == "tesa"; - } - } - /// /// Gets or sets a value indicating whether NoDctDecimate. /// @@ -772,13 +778,7 @@ namespace HandBrakeWPF.ViewModels case "merange": if (int.TryParse(optionValue, out parseInt)) { - newChoice = - AdvancedChoicesHelper.MotionEstimationRange.SingleOrDefault( - choice => choice.Value == parseInt.ToString(CultureInfo.InvariantCulture)); - if (newChoice != null) - { - this.MotionEstimationRange = newChoice; - } + this.MotionEstimationRange = parseInt; } break; @@ -1015,8 +1015,7 @@ namespace HandBrakeWPF.ViewModels AdvancedChoicesHelper.MotionEstimationMethod.SingleOrDefault(choice => choice.IsDefault); this.SubpixelMotionEstimation = AdvancedChoicesHelper.SubpixelMotionEstimation.SingleOrDefault(choice => choice.IsDefault); - this.MotionEstimationRange = - AdvancedChoicesHelper.MotionEstimationRange.SingleOrDefault(choice => choice.IsDefault); + this.MotionEstimationRange = 16; this.Analysis = AdvancedChoicesHelper.Analysis.SingleOrDefault(choice => choice.IsDefault); this.EightByEightDct = true; this.CabacEntropyCoding = true; @@ -1107,11 +1106,9 @@ namespace HandBrakeWPF.ViewModels newOptions.Add("subme=" + this.SubpixelMotionEstimation.Value); } - string motionEstimation = this.MotionEstimationMethod.Value; - if ((motionEstimation == "umh" || motionEstimation == "esa" || motionEstimation == "tesa") && - !this.MotionEstimationRange.IsDefault) + if (this.MotionEstimationRange != 16) { - newOptions.Add("merange=" + this.MotionEstimationRange.Value); + newOptions.Add("merange=" + this.MotionEstimationRange); } if (!this.Analysis.IsDefault) diff --git a/win/CS/HandBrakeWPF/Views/AdvancedView.xaml b/win/CS/HandBrakeWPF/Views/AdvancedView.xaml index 2043680ff..785102cd2 100644 --- a/win/CS/HandBrakeWPF/Views/AdvancedView.xaml +++ b/win/CS/HandBrakeWPF/Views/AdvancedView.xaml @@ -6,6 +6,7 @@ xmlns:Helpers="clr-namespace:HandBrakeWPF.Helpers" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:Properties="clr-namespace:HandBrakeWPF.Properties" + xmlns:controls="clr-namespace:HandBrakeWPF.Controls" x:Name="advancedView" mc:Ignorable="d" > @@ -87,7 +88,6 @@ - @@ -231,47 +231,23 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -281,7 +257,9 @@ - + + + - + + + + + + + + + + @@ -405,19 +417,20 @@ - + + + - - - - - - - - - - - - - - - - - + - + + + diff --git a/win/CS/HandBrakeWPF/Views/ShellView.xaml b/win/CS/HandBrakeWPF/Views/ShellView.xaml index b6f3cc9eb..9bfee4bc1 100644 --- a/win/CS/HandBrakeWPF/Views/ShellView.xaml +++ b/win/CS/HandBrakeWPF/Views/ShellView.xaml @@ -4,9 +4,9 @@ xmlns:Data="clr-namespace:System.Windows.Data;assembly=PresentationFramework" xmlns:Converters="clr-namespace:HandBrakeWPF.Converters" Title="{Data:Binding Path=WindowTitle}" Width="1015" - Height="652" + Height="670" MinWidth="1015" - MinHeight="652" + MinHeight="670" AllowDrop="True" Background="#FFF0F0F0" FontSize="11" -- cgit v1.2.3