diff options
author | sr55 <[email protected]> | 2013-01-11 22:50:48 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2013-01-11 22:50:48 +0000 |
commit | d917bc2ad4fa1e2c12828f0e234a32cd19f682c1 (patch) | |
tree | 82a53a33b2f6141190760ed07225ec568acaa00c /win/CS/HandBrakeWPF | |
parent | 00c32ae2173c22f7c3aa4ac1f432487c0110138e (diff) |
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
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs | 55 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/AdvancedView.xaml | 273 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Views/ShellView.xaml | 4 |
3 files changed, 147 insertions, 185 deletions
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 /// <summary>
/// The motion estimation range.
/// </summary>
- private AdvancedChoice motionEstimationRange;
+ private int motionEstimationRange;
/// <summary>
/// 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 /// <summary>
/// Gets or sets MotionEstimationRange.
/// </summary>
- public AdvancedChoice MotionEstimationRange
+ public int MotionEstimationRange
{
get
{
@@ -435,25 +441,25 @@ 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();
}
}
/// <summary>
- /// Gets a value indicating whether MotionEstimationRangeVisible.
- /// </summary>
- public bool MotionEstimationRangeVisible
- {
- get
- {
- string motionMethod = this.MotionEstimationMethod.Value;
- return motionMethod == "umh" || motionMethod == "esa" || motionMethod == "tesa";
- }
- }
-
- /// <summary>
/// Gets or sets a value indicating whether NoDctDecimate.
/// </summary>
public bool 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 @@ <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- Left Column -->
@@ -231,47 +231,23 @@ </ComboBox>
</Grid>
</StackPanel>
-
- <!-- Psychvisual -->
- <StackPanel Orientation="Vertical">
- <TextBlock Grid.Row="0"
- Margin="10,5,0,0"
- FontWeight="Bold"
- Text="Psychovisual: "
- />
- <StackPanel Orientation="Horizontal">
- <Label Width="110"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- HorizontalContentAlignment="Right"
- Content="No DCT-Decimate:"
- />
- <CheckBox HorizontalAlignment="Left"
- VerticalAlignment="Center"
- IsChecked="{Binding NoDctDecimate}"
- Style="{StaticResource LongToolTipHolder}"
- >
- <CheckBox.ToolTip>
- <TextBlock Style="{StaticResource LongToolTip}" Text="{x:Static Properties:Resources.Advanced_NoDctDecimateToolTip}" />
- </CheckBox.ToolTip>
- </CheckBox>
-
- </StackPanel>
- </StackPanel>
-
</StackPanel>
- <!-- Analysis (Center Column) -->
- <StackPanel Grid.Row="0"
- Grid.Column="1"
- Orientation="Vertical"
- >
- <TextBlock Grid.Row="0"
- Margin="10,5,0,0"
- FontWeight="Bold"
- Text="Analysis: "
- />
- <Grid HorizontalAlignment="Left" VerticalAlignment="Top">
+ <!-- Right Column -->
+ <Grid Grid.Row="0" Grid.Column="1">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="*" />
+ </Grid.RowDefinitions>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
+
+ <!-- Analysis -->
+ <TextBlock Text="Analysis: " Grid.Row="0" Margin="10,5,0,0" FontWeight="Bold" />
+ <Grid Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Top">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
@@ -281,7 +257,9 @@ </Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="*" MinWidth="100" />
+ <ColumnDefinition Width="Auto" MinWidth="100" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Label Content="Adaptive B-Frames:"
@@ -372,29 +350,63 @@ <Label Grid.Row="4"
Grid.Column="0"
Content="Motion Est Range:"
- Style="{StaticResource AdvancedLabel}"
- Visibility="{Binding MotionEstimationRangeVisible,
- Converter={StaticResource VisibilityConverter}}"
+ Style="{StaticResource AdvancedLabel}" />
+ <controls:NumberBox Grid.Row="4"
+ Grid.Column="1"
+ Width="120"
+ Height="22"
+ MaxWidth="120"
+ Minimum="4" Maximum="64"
+ Number="{Binding MotionEstimationRange, Mode=TwoWay}"
+ ToolTip="{x:Static Properties:Resources.Advanced_MotionEstimationRangeToolTip}"
+ />
+
+
+ <!-- Column 2 -->
+ <Label Grid.Row="0" Grid.Column="2"
+ Height="28"
+ HorizontalAlignment="Right"
+ VerticalAlignment="Top"
+ Content="Partition Type:"
/>
- <ComboBox Grid.Row="4"
- Grid.Column="1"
- Width="120"
- Height="22"
- MaxWidth="120"
+ <ComboBox Grid.Row="0" Grid.Column="3"
+ Width="100"
+ Height="23"
+ MaxWidth="100"
+ HorizontalAlignment="Right"
+ VerticalAlignment="Top"
DisplayMemberPath="Label"
- ItemsSource="{x:Static Helpers:AdvancedChoicesHelper.MotionEstimationRange}"
- SelectedItem="{Binding MotionEstimationRange}"
+ ItemsSource="{x:Static Helpers:AdvancedChoicesHelper.Analysis}"
+ SelectedItem="{Binding Analysis}"
Style="{StaticResource LongToolTipHolder}"
- Visibility="{Binding MotionEstimationRangeVisible,
- Converter={StaticResource VisibilityConverter}}" Margin="0,0,0,2" VerticalAlignment="Bottom">
+ >
<ComboBox.ToolTip>
- <TextBlock Style="{StaticResource LongToolTip}" Text="{x:Static Properties:Resources.Advanced_MotionEstimationRangeToolTip}" />
+ <TextBlock Style="{StaticResource LongToolTip}" Text="{x:Static Properties:Resources.Advanced_AnalysisToolTip}" />
</ComboBox.ToolTip>
</ComboBox>
- </Grid>
- <Grid Width="300"
- Height="80"
+ <Label Grid.Row="1" Grid.Column="2" Height="28" HorizontalAlignment="Right" VerticalAlignment="Top" Content="Trellis:" />
+ <ComboBox Grid.Row="1"
+ Grid.Column="3"
+ Width="100"
+ Height="23"
+ MaxWidth="100"
+ HorizontalAlignment="Right"
+ VerticalAlignment="Top"
+ DisplayMemberPath="Label"
+ ItemsSource="{x:Static Helpers:AdvancedChoicesHelper.Trellis}"
+ SelectedItem="{Binding Trellis}"
+ Style="{StaticResource LongToolTipHolder}">
+ <ComboBox.ToolTip>
+ <TextBlock Style="{StaticResource LongToolTip}" Text="{x:Static Properties:Resources.Advanced_TrellisToolTip}" />
+ </ComboBox.ToolTip>
+ </ComboBox>
+ </Grid>
+
+ <!-- PhysoVisual -->
+ <TextBlock Text="Psychovisual: " Grid.Row="2" Margin="10,5,0,0" FontWeight="Bold" />
+ <Grid Grid.Row="3"
+ Height="90"
HorizontalAlignment="Left"
VerticalAlignment="Top"
>
@@ -405,19 +417,20 @@ </Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="*" MinWidth="100" />
+ <ColumnDefinition Width="Auto" MinWidth="100" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
- <Label Grid.Row="0"
- Grid.Column="0"
+ <Label Grid.Row="0" Grid.Column="0"
Content="Adaptive Quant Strength:"
Style="{StaticResource AdvancedLabel}"
/>
- <Slider Grid.Row="0"
- Grid.Column="1"
+ <Slider Grid.Row="0" Grid.Column="1"
IsSnapToTickEnabled="True"
LargeChange="0.2"
Maximum="2.0"
+ Width="150"
Minimum="0.0"
SmallChange="0.1"
Style="{StaticResource LongToolTipHolder}"
@@ -430,19 +443,18 @@ </Slider.ToolTip>
</Slider>
- <Label Grid.Row="1"
- Grid.Column="0"
- Content="Psychovisual Rate Distortion:"
+ <Label Grid.Row="1" Grid.Column="0"
+ Content="Rate Distortion:"
Style="{StaticResource AdvancedLabel}"
Visibility="{Binding PsychovisualRateDistortionVisible,
Converter={StaticResource VisibilityConverter}}"
/>
- <Slider Grid.Row="1"
- Grid.Column="1"
+ <Slider Grid.Row="1" Grid.Column="1"
IsSnapToTickEnabled="True"
LargeChange="0.2"
Maximum="2.0"
Minimum="0.0"
+ Width="150"
SmallChange="0.1"
Style="{StaticResource LongToolTipHolder}"
TickFrequency="0.1"
@@ -456,19 +468,18 @@ </Slider.ToolTip>
</Slider>
- <Label Grid.Row="2"
- Grid.Column="0"
+ <Label Grid.Row="2" Grid.Column="0"
Content="Psychovisual Trellis:"
Style="{StaticResource AdvancedLabel}"
Visibility="{Binding PsychovisualTrellisVisible,
Converter={StaticResource VisibilityConverter}}"
/>
- <Slider Grid.Row="2"
- Grid.Column="1"
+ <Slider Grid.Row="2" Grid.Column="1"
IsSnapToTickEnabled="True"
LargeChange="0.2"
Maximum="1.0"
Minimum="0.0"
+ Width="150"
SmallChange="0.05"
Style="{StaticResource LongToolTipHolder}"
TickFrequency="0.05"
@@ -481,85 +492,35 @@ <TextBlock Style="{StaticResource LongToolTip}" Text="{x:Static Properties:Resources.Advanced_PsychovisualTrellisToolTip}" />
</Slider.ToolTip>
</Slider>
- </Grid>
- </StackPanel>
-
- <!-- Analysis (Right Column) -->
- <StackPanel Grid.Row="0"
- Grid.Column="2"
- Orientation="Vertical"
- >
- <Grid Margin="0,20,0,0">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="*" MinWidth="100" />
- </Grid.ColumnDefinitions>
- <Label Grid.Column="0"
- Height="28"
- HorizontalAlignment="Right"
- VerticalAlignment="Top"
- Content="Partition Type:"
- />
- <ComboBox Grid.Column="1"
- Width="100"
- Height="23"
- MaxWidth="100"
- HorizontalAlignment="Right"
- VerticalAlignment="Top"
- DisplayMemberPath="Label"
- ItemsSource="{x:Static Helpers:AdvancedChoicesHelper.Analysis}"
- SelectedItem="{Binding Analysis}"
- Style="{StaticResource LongToolTipHolder}"
- >
- <ComboBox.ToolTip>
- <TextBlock Style="{StaticResource LongToolTip}" Text="{x:Static Properties:Resources.Advanced_AnalysisToolTip}" />
- </ComboBox.ToolTip>
- </ComboBox>
+ <Label Grid.Row="0" Grid.Column="2" Width="110"
+ HorizontalAlignment="Left"
+ VerticalAlignment="Center"
+ HorizontalContentAlignment="Right"
+ Content="No DCT-Decimate:"
+ />
+ <CheckBox Grid.Row="0" Grid.Column="3" HorizontalAlignment="Left"
+ VerticalAlignment="Center"
+ IsChecked="{Binding NoDctDecimate}"
+ Style="{StaticResource LongToolTipHolder}"
+ >
+ <CheckBox.ToolTip>
+ <TextBlock Style="{StaticResource LongToolTip}" Text="{x:Static Properties:Resources.Advanced_NoDctDecimateToolTip}" />
+ </CheckBox.ToolTip>
+ </CheckBox>
<Label Grid.Row="1"
- Grid.Column="0"
- Height="28"
- HorizontalAlignment="Right"
- VerticalAlignment="Top"
- Content="Trellis:"
- />
- <ComboBox Grid.Row="1"
- Grid.Column="1"
- Width="100"
- Height="23"
- MaxWidth="100"
- HorizontalAlignment="Right"
- VerticalAlignment="Top"
- DisplayMemberPath="Label"
- ItemsSource="{x:Static Helpers:AdvancedChoicesHelper.Trellis}"
- SelectedItem="{Binding Trellis}"
- Style="{StaticResource LongToolTipHolder}"
- >
- <ComboBox.ToolTip>
- <TextBlock Style="{StaticResource LongToolTip}" Text="{x:Static Properties:Resources.Advanced_TrellisToolTip}" />
- </ComboBox.ToolTip>
- </ComboBox>
-
-
- <Label Grid.Row="2"
- Grid.Column="0"
+ Grid.Column="2"
Height="28"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Content="Deblocking:"
/>
- <ComboBox Grid.Row="2"
- Grid.Column="1"
- Width="100"
+ <StackPanel Orientation="Vertical" Grid.Row="1" Grid.Column="3" Grid.RowSpan="2">
+ <ComboBox
+ Width="85"
Height="23"
- MaxWidth="100"
+ MaxWidth="85"
HorizontalAlignment="Right"
VerticalAlignment="Top"
DisplayMemberPath="Label"
@@ -567,15 +528,15 @@ SelectedItem="{Binding DeblockingStrength}"
Style="{StaticResource LongToolTipHolder}"
>
- <ComboBox.ToolTip>
- <TextBlock Style="{StaticResource LongToolTip}" Text="{x:Static Properties:Resources.Advanced_DeblockingToolTip}" />
- </ComboBox.ToolTip>
- </ComboBox>
- <ComboBox Grid.Row="3"
- Grid.Column="1"
- Width="100"
+ <ComboBox.ToolTip>
+ <TextBlock Style="{StaticResource LongToolTip}" Text="{x:Static Properties:Resources.Advanced_DeblockingToolTip}" />
+ </ComboBox.ToolTip>
+ </ComboBox>
+ <ComboBox
+ Width="85"
Height="23"
- MaxWidth="100"
+ MaxWidth="85"
+ Margin="0,5,0,0"
HorizontalAlignment="Right"
VerticalAlignment="Top"
DisplayMemberPath="Label"
@@ -583,12 +544,16 @@ SelectedItem="{Binding DeblockingThreshold}"
Style="{StaticResource LongToolTipHolder}"
>
- <ComboBox.ToolTip>
- <TextBlock Style="{StaticResource LongToolTip}" Text="{x:Static Properties:Resources.Advanced_DeblockingToolTip}" />
- </ComboBox.ToolTip>
- </ComboBox>
+ <ComboBox.ToolTip>
+ <TextBlock Style="{StaticResource LongToolTip}" Text="{x:Static Properties:Resources.Advanced_DeblockingToolTip}" />
+ </ComboBox.ToolTip>
+ </ComboBox>
+ </StackPanel>
+
</Grid>
- </StackPanel>
+
+ </Grid>
+
</Grid>
</StackPanel>
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"
|