summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF
diff options
context:
space:
mode:
authorsr55 <[email protected]>2021-03-29 21:08:12 +0100
committersr55 <[email protected]>2021-03-29 21:08:12 +0100
commit6e4d106cb1f0f4c24451efb90e352e40f7da8d06 (patch)
tree4aa4311942c9548e0e188d918b2118c010a4617f /win/CS/HandBrakeWPF
parent3c2bb9cd9c4a734209174a77db4f6a7ba523c3a3 (diff)
WinGui: Implement the Pad filter in the UI. (For testing - Note, summary, preview and preset support is not implemented yet.)
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r--win/CS/HandBrakeWPF/Model/Filters/PadColour.cs27
-rw-r--r--win/CS/HandBrakeWPF/Model/Filters/PaddingFilter.cs6
-rw-r--r--win/CS/HandBrakeWPF/Model/Filters/PaddingMode.cs18
-rw-r--r--win/CS/HandBrakeWPF/Properties/Resources.Designer.cs48
-rw-r--r--win/CS/HandBrakeWPF/Properties/Resources.resx24
-rw-r--r--win/CS/HandBrakeWPF/Properties/ResourcesTooltips.Designer.cs9
-rw-r--r--win/CS/HandBrakeWPF/Properties/ResourcesTooltips.resx3
-rw-r--r--win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs14
-rw-r--r--win/CS/HandBrakeWPF/ViewModelItems/Filters/PadFilter.cs175
-rw-r--r--win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml30
10 files changed, 267 insertions, 87 deletions
diff --git a/win/CS/HandBrakeWPF/Model/Filters/PadColour.cs b/win/CS/HandBrakeWPF/Model/Filters/PadColour.cs
new file mode 100644
index 000000000..dcecfb836
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Model/Filters/PadColour.cs
@@ -0,0 +1,27 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="PadColour.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Model.Filters
+{
+ using HandBrake.Interop.Attributes;
+
+ using HandBrakeWPF.Properties;
+
+ public enum PadColour
+ {
+ [DisplayName(typeof(Resources), "PadColour_Black")]
+ [ShortName("black")]
+ Black = 0,
+
+ [DisplayName(typeof(Resources), "PadColour_White")]
+ [ShortName("white")]
+ White,
+
+ [DisplayName(typeof(Resources), "PadColour_Custom")]
+ [ShortName("custom")]
+ Custom,
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/Model/Filters/PaddingFilter.cs b/win/CS/HandBrakeWPF/Model/Filters/PaddingFilter.cs
index 03b0e660a..60f5758bb 100644
--- a/win/CS/HandBrakeWPF/Model/Filters/PaddingFilter.cs
+++ b/win/CS/HandBrakeWPF/Model/Filters/PaddingFilter.cs
@@ -1,5 +1,5 @@
// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="PaddingFilter.cs" company="HandBrake Project (https://handbrake.fr)">
+// <copyright file="PaddingFilter.cs" company="HandBrake Project (http://handbrake.fr)">
// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
// </copyright>
// <summary>
@@ -18,5 +18,9 @@ namespace HandBrakeWPF.Model.Filters
public int X { get; set; }
public int Y { get; set; }
+
+ public int W { get; set; }
+
+ public int H { get; set; }
}
}
diff --git a/win/CS/HandBrakeWPF/Model/Filters/PaddingMode.cs b/win/CS/HandBrakeWPF/Model/Filters/PaddingMode.cs
index 63323c4bb..e0a930ce6 100644
--- a/win/CS/HandBrakeWPF/Model/Filters/PaddingMode.cs
+++ b/win/CS/HandBrakeWPF/Model/Filters/PaddingMode.cs
@@ -19,17 +19,17 @@ namespace HandBrakeWPF.Model.Filters
[ShortName("none")]
None = 0,
- [DisplayName(typeof(Resources), "PaddingMode_Fill")]
- [ShortName("fill")]
- FirstMatch,
+ //[DisplayName(typeof(Resources), "PaddingMode_Fill")]
+ //[ShortName("fill")]
+ //FirstMatch,
- [DisplayName(typeof(Resources), "PaddingMode_Width")]
- [ShortName("width")]
- Width,
+ //[DisplayName(typeof(Resources), "PaddingMode_Width")]
+ //[ShortName("width")]
+ //Width,
- [DisplayName(typeof(Resources), "PaddingMode_Height")]
- [ShortName("height")]
- Height,
+ //[DisplayName(typeof(Resources), "PaddingMode_Height")]
+ //[ShortName("height")]
+ //Height,
[DisplayName(typeof(Resources), "PaddingMode_Custom")]
[ShortName("custom")]
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
index 4019b1bc9..8dfcbb1e4 100644
--- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
+++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
@@ -2821,7 +2821,7 @@ namespace HandBrakeWPF.Properties {
/// <summary>
/// Looks up a localized string similar to Please be aware that HandBrake is no longer supported on any version of Windows 7 or Windows 8.
///
- ///While you can continue using the applicaiton at your own risk, please be aware that certain freatures are non-functional and there may be other unknown issues. There is no support available when these issues occur.
+ ///While you can continue using the application at your own risk, please be aware that certain features are non-functional and there may be other unknown issues. There is no support available when these issues occur.
///
///Support for Windows 7 and 8 was deprecated in the 1.3 series. This means there will be no further updates to correct issues on these platforms.
///
@@ -4023,6 +4023,33 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to Black.
+ /// </summary>
+ public static string PadColour_Black {
+ get {
+ return ResourceManager.GetString("PadColour_Black", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Custom.
+ /// </summary>
+ public static string PadColour_Custom {
+ get {
+ return ResourceManager.GetString("PadColour_Custom", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to White.
+ /// </summary>
+ public static string PadColour_White {
+ get {
+ return ResourceManager.GetString("PadColour_White", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Custom (Not Limited).
/// </summary>
public static string PaddingMode_Custom {
@@ -4032,7 +4059,7 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
- /// Looks up a localized string similar to Fill (pad to resolution limit).
+ /// Looks up a localized string similar to Fill (Surround).
/// </summary>
public static string PaddingMode_Fill {
get {
@@ -4041,7 +4068,7 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
- /// Looks up a localized string similar to Height (pad up to res limit).
+ /// Looks up a localized string similar to Height (Pillarbox).
/// </summary>
public static string PaddingMode_Height {
get {
@@ -4059,7 +4086,7 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
- /// Looks up a localized string similar to Width (pad up to res limit).
+ /// Looks up a localized string similar to Width (Letterbox).
/// </summary>
public static string PaddingMode_Width {
get {
@@ -4176,7 +4203,7 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
- /// Looks up a localized string similar to Borders.
+ /// Looks up a localized string similar to Borders:.
/// </summary>
public static string PictureSettingsView_Borders {
get {
@@ -4293,7 +4320,7 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
- /// Looks up a localized string similar to Padding Colour:.
+ /// Looks up a localized string similar to Colour:.
/// </summary>
public static string PictureSettingsView_PaddingColour {
get {
@@ -4302,6 +4329,15 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to RGB Value:.
+ /// </summary>
+ public static string PictureSettingsView_PaddingCustomColour {
+ get {
+ return ResourceManager.GetString("PictureSettingsView_PaddingCustomColour", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to PAR:.
/// </summary>
public static string PictureSettingsView_PAR {
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx
index 77733c8ef..47de39e99 100644
--- a/win/CS/HandBrakeWPF/Properties/Resources.resx
+++ b/win/CS/HandBrakeWPF/Properties/Resources.resx
@@ -2234,25 +2234,25 @@ Please choose a different preset.</value>
<value>Custom (Not Limited)</value>
</data>
<data name="PaddingMode_Fill" xml:space="preserve">
- <value>Fill (pad to resolution limit)</value>
+ <value>Fill (Surround)</value>
</data>
<data name="PaddingMode_Height" xml:space="preserve">
- <value>Height (pad up to res limit)</value>
+ <value>Height (Pillarbox)</value>
</data>
<data name="PaddingMode_None" xml:space="preserve">
<value>None</value>
</data>
<data name="PaddingMode_Width" xml:space="preserve">
- <value>Width (pad up to res limit)</value>
+ <value>Width (Letterbox)</value>
</data>
<data name="PictureSettingsView_Padding" xml:space="preserve">
<value>Padding:</value>
</data>
<data name="PictureSettingsView_PaddingColour" xml:space="preserve">
- <value>Padding Colour:</value>
+ <value>Colour:</value>
</data>
<data name="PictureSettingsView_Borders" xml:space="preserve">
- <value>Borders</value>
+ <value>Borders:</value>
</data>
<data name="PictureSettingsView_ResAndScaling" xml:space="preserve">
<value>Resolution and Scaling:</value>
@@ -2469,4 +2469,16 @@ Support for Windows 7 and 8 was deprecated in the 1.3 series. This means there w
This warning will display only twice.</value>
</data>
-</root>
+ <data name="PadColour_Black" xml:space="preserve">
+ <value>Black</value>
+ </data>
+ <data name="PadColour_Custom" xml:space="preserve">
+ <value>Custom</value>
+ </data>
+ <data name="PadColour_White" xml:space="preserve">
+ <value>White</value>
+ </data>
+ <data name="PictureSettingsView_PaddingCustomColour" xml:space="preserve">
+ <value>RGB Value:</value>
+ </data>
+</root> \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesTooltips.Designer.cs b/win/CS/HandBrakeWPF/Properties/ResourcesTooltips.Designer.cs
index 01a4f44a8..aadfdc2dc 100644
--- a/win/CS/HandBrakeWPF/Properties/ResourcesTooltips.Designer.cs
+++ b/win/CS/HandBrakeWPF/Properties/ResourcesTooltips.Designer.cs
@@ -592,6 +592,15 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to This field can accept RGB values such as: &quot;0xFF0000&quot; or colour names such as &quot;red&quot;. For a full list of named colours, see the padding filter documentation. .
+ /// </summary>
+ public static string PictureSettingsView_PaddingCustomColourTooltip {
+ get {
+ return ResourceManager.GetString("PictureSettingsView_PaddingCustomColourTooltip", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Pixel aspect defines the shape of the pixels.
///A 1:1 ratio defines a square pixel. Other values define rectangular shapes.
///Players will scale the image in order to achieve the specified aspect..
diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesTooltips.resx b/win/CS/HandBrakeWPF/Properties/ResourcesTooltips.resx
index cfc83b6c5..2bb780509 100644
--- a/win/CS/HandBrakeWPF/Properties/ResourcesTooltips.resx
+++ b/win/CS/HandBrakeWPF/Properties/ResourcesTooltips.resx
@@ -471,4 +471,7 @@ When disabled, it will use the path in the destination box on the main window if
<data name="FiltersView_ChromaSmooth" xml:space="preserve">
<value>Chroma Smooth Filter</value>
</data>
+ <data name="PictureSettingsView_PaddingCustomColourTooltip" xml:space="preserve">
+ <value>This field can accept RGB values such as: "0xFF0000" or colour names such as "red". For a full list of named colours, see the padding filter documentation. </value>
+ </data>
</root> \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs
index a5e8d26e8..dee655e15 100644
--- a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs
+++ b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs
@@ -472,8 +472,18 @@ namespace HandBrakeWPF.Services.Encode.Factories
// Padding Filter
if (job.Padding.Enabled)
- {
- string padSettings = string.Format("width={0}:height={1}:color={2}:x={3}:y={4}", job.Width, job.Height, job.Padding.Color, job.Padding.X, job.Padding.Y);
+ {
+ // Calculate the new Width / Height
+ int? width = job.Width;
+ int? height = job.Height;
+ if (job.Padding.Enabled)
+ {
+ width = width + job.Padding.W;
+ height = height + job.Padding.H;
+ }
+
+ // Setup the filter.
+ string padSettings = string.Format("width={0}:height={1}:color={2}:x={3}:y={4}", width, height, job.Padding.Color, job.Padding.X, job.Padding.Y);
string unparsedPadSettingsJson = HandBrakeFilterHelpers.GenerateFilterSettingJson((int)hb_filter_ids.HB_FILTER_PAD, null, null, padSettings);
if (!string.IsNullOrEmpty(unparsedPadSettingsJson))
{
diff --git a/win/CS/HandBrakeWPF/ViewModelItems/Filters/PadFilter.cs b/win/CS/HandBrakeWPF/ViewModelItems/Filters/PadFilter.cs
index 3dc966b0f..5b268c2c0 100644
--- a/win/CS/HandBrakeWPF/ViewModelItems/Filters/PadFilter.cs
+++ b/win/CS/HandBrakeWPF/ViewModelItems/Filters/PadFilter.cs
@@ -1,27 +1,17 @@
// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="DeblockFilter.cs" company="HandBrake Project (http://handbrake.fr)">
+// <copyright file="PadFilter.cs" company="HandBrake Project (http://handbrake.fr)">
// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
// </copyright>
-// <summary>
-// Defines the DeblockFilter type.
-// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace HandBrakeWPF.ViewModelItems.Filters
{
using System.Collections.Generic;
- using System.ComponentModel;
- using System.Globalization;
- using System.Linq;
using Caliburn.Micro;
- using HandBrake.Interop.Interop;
- using HandBrake.Interop.Interop.HbLib;
-
using HandBrakeWPF.Model.Filters;
using HandBrakeWPF.Services.Encode.Model;
- using HandBrakeWPF.Services.Encode.Model.Models;
using HandBrakeWPF.Services.Presets.Model;
using HandBrakeWPF.Services.Scan.Model;
using HandBrakeWPF.Utilities;
@@ -31,6 +21,12 @@ namespace HandBrakeWPF.ViewModelItems.Filters
public class PadFilter : PropertyChangedBase
{
private readonly Action triggerTabChanged;
+ private int top, bottom, left, right;
+ private EncodeTask currentTask;
+ private PaddingMode mode;
+ private PadColour colour;
+
+ private string customColour;
public PadFilter(EncodeTask currentTask, Action triggerTabChanged)
{
@@ -38,71 +34,134 @@ namespace HandBrakeWPF.ViewModelItems.Filters
this.CurrentTask = currentTask;
}
- public EncodeTask CurrentTask { get; private set; }
+ public EncodeTask CurrentTask
+ {
+ get => this.currentTask;
+ private set => this.currentTask = value;
+ }
public IEnumerable<PaddingMode> PaddingModes => EnumHelper<PaddingMode>.GetEnumList();
- public PaddingMode Mode { get; set; }
+ public PaddingMode Mode
+ {
+ get => this.mode;
+ set
+ {
+ this.mode = value;
+ this.IsCustomPaddingEnabled = false;
+
+ switch (value)
+ {
+ case PaddingMode.Custom:
+ this.currentTask.Padding.Enabled = true;
+ IsCustomPaddingEnabled = true;
+ break;
+ case PaddingMode.None:
+ default:
+ this.currentTask.Padding.Enabled = false;
+ break;
+ }
+
+ this.NotifyOfPropertyChange(() => this.IsCustomPaddingEnabled);
+ this.NotifyOfPropertyChange(() => this.IsCustomColourVisible);
+ }
+ }
+
+ public bool IsCustomPaddingEnabled { get; set; }
- public IEnumerable<string> PaddingColours { get; } = new List<string>() { "Black", "White", "Custom" };
+ public IEnumerable<PadColour> PaddingColours => EnumHelper<PadColour>.GetEnumList();
- public int X
+ public PadColour Colour
{
get
{
- return this.CurrentTask.Padding.X;
+ return colour;
}
set
{
- this.CurrentTask.Padding.X = value;
- this.NotifyOfPropertyChange(() => this.X);
+ this.colour = value;
+ this.SetColour();
+ this.NotifyOfPropertyChange(() => this.Colour);
+ this.NotifyOfPropertyChange(() => this.IsCustomColourVisible);
this.triggerTabChanged();
}
}
- public int Y
+ public string CustomColour
{
- get
+ get => this.customColour;
+ set
{
- return this.CurrentTask.Padding.Y;
+ this.customColour = value;
+ this.SetColour();
+ this.NotifyOfPropertyChange(() => this.CustomColour);
}
+ }
+
+ public bool IsCustomColourVisible => this.IsCustomPaddingEnabled && this.Colour == PadColour.Custom;
+
+ public int Top
+ {
+ get => this.top;
set
{
- this.CurrentTask.Padding.Y = value;
- this.NotifyOfPropertyChange(() => this.Y);
+ this.top = value;
+ this.CalculatePosition();
+ this.NotifyOfPropertyChange(() => this.Top);
this.triggerTabChanged();
}
}
- public string Colour
+ public int Bottom
{
- get
+ get => this.bottom;
+
+ set
{
- return this.CurrentTask.Padding.Color;
+ this.bottom = value;
+ this.CalculatePosition();
+ this.NotifyOfPropertyChange(() => this.Bottom);
+ this.triggerTabChanged();
}
+ }
+
+ public int Left
+ {
+ get => this.left;
set
{
- this.CurrentTask.Padding.Color = value;
- this.NotifyOfPropertyChange(() => this.Colour);
+ this.left = value;
+ this.CalculatePosition();
+ this.NotifyOfPropertyChange(() => this.Left);
this.triggerTabChanged();
}
}
-
- public void SetPreset(Preset preset, EncodeTask task)
+
+ public int Right
{
- this.CurrentTask = task;
+ get => this.right;
- if (preset == null)
+ set
{
- return;
+ this.right = value;
+ this.CalculatePosition();
+ this.NotifyOfPropertyChange(() => this.Right);
+ this.triggerTabChanged();
}
-
- this.NotifyOfPropertyChange(() => this.X);
- this.NotifyOfPropertyChange(() => this.Y);
- this.NotifyOfPropertyChange(() => this.Colour);
+ }
+
+ private void CalculatePosition()
+ {
+ // Figure the X,Y coordinate
+ this.CurrentTask.Padding.X = this.Left;
+ this.CurrentTask.Padding.Y = this.Top;
+
+ // Calculate the total padding
+ this.currentTask.Padding.W = this.Left + this.Right;
+ this.currentTask.Padding.H = this.Top + this.Bottom;
}
public void UpdateTask(EncodeTask task)
@@ -117,27 +176,43 @@ namespace HandBrakeWPF.ViewModelItems.Filters
return false;
}
- if (preset.Task.Padding.X != this.X)
- {
- return false;
- }
+ return true;
+ }
- if (preset.Task.Padding.Y != this.Y)
- {
- return false;
- }
+ public void SetSource(Source source, Title title, Preset preset, EncodeTask task)
+ {
+ this.CurrentTask = task;
+ }
- if (preset.Task.Padding.Color != this.Colour)
+ private void SetColour()
+ {
+ switch (this.Colour)
{
- return false;
+ case PadColour.Black:
+ this.CurrentTask.Padding.Color = "black";
+ break;
+ case PadColour.White:
+ this.CurrentTask.Padding.Color = "white";
+ break;
+ case PadColour.Custom:
+ this.CurrentTask.Padding.Color = CustomColour?.Trim().ToLower();
+ break;
+ default:
+ this.CurrentTask.Padding.Color = "black";
+ break;
}
-
- return true;
}
- public void SetSource(Source source, Title title, Preset preset, EncodeTask task)
+ public void SetPreset(Preset preset, EncodeTask task)
{
this.CurrentTask = task;
+
+ if (preset == null)
+ {
+ return;
+ }
+
+ this.NotifyOfPropertyChange(() => this.Colour);
}
}
}
diff --git a/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml b/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml
index 8fba7bbdc..4a0f26a77 100644
--- a/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml
+++ b/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml
@@ -214,7 +214,7 @@
</Grid>
<!-- Padding Panel -->
- <!--<TextBlock Text="{x:Static Properties:Resources.PictureSettingsView_Borders}" FontSize="12" FontWeight="Bold" Grid.Row="0" Grid.Column="2" Margin="20,10,0,15" />
+ <TextBlock Text="{x:Static Properties:Resources.PictureSettingsView_Borders}" FontSize="12" FontWeight="Bold" Grid.Row="0" Grid.Column="2" Margin="20,10,0,15" />
<Grid Name="PaddingPanel" Margin="20,0,0,0" Grid.Row="1" Grid.Column="2">
<Grid.ColumnDefinitions>
@@ -231,7 +231,7 @@
<TextBlock Text="{x:Static Properties:Resources.PictureSettingsView_Padding}" Grid.Row="0" Grid.Column="0" />
- <ComboBox ItemsSource="{Binding PaddingFilter.PaddingModes}" SelectedItem="{Binding PaddingFilter.Mode}" Grid.Row="0" Grid.Column="1" />
+ <ComboBox ItemsSource="{Binding PaddingFilter.PaddingModes}" SelectedItem="{Binding PaddingFilter.Mode}" Grid.Row="0" Grid.Column="1" Width="120" />
<Grid Margin="0,10,0,10" Grid.Row="1" Grid.ColumnSpan="2">
<Grid.RowDefinitions>
@@ -255,32 +255,36 @@
<Label Content="{x:Static Properties:Resources.PictureSettingsView_Left}" Grid.Row="2" Grid.Column="0" HorizontalAlignment="Center" />
<Label Content="{x:Static Properties:Resources.PictureSettingsView_Right}" Grid.Row="2" Grid.Column="4" HorizontalAlignment="Center" />
- <controls:NumberBox Width="60" HorizontalAlignment="Left" Margin="0,0,0,5" IsEnabled="{Binding IsCustomCrop}" Grid.Row="1" Grid.Column="2"
- Minimum="0" Modulus="2" Number="{Binding CropTop, Mode=TwoWay}" UpdateBindingOnTextChange="True" ShowIncrementButtons="True" AllowEmpty="False"
+ <controls:NumberBox Width="60" HorizontalAlignment="Left" Margin="0,0,0,5" IsEnabled="{Binding PaddingFilter.IsCustomPaddingEnabled}" Grid.Row="1" Grid.Column="2"
+ Minimum="0" Modulus="2" Number="{Binding PaddingFilter.Top, Mode=TwoWay}" UpdateBindingOnTextChange="True" ShowIncrementButtons="True" AllowEmpty="False"
ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_CropTop}"
AutomationProperties.Name="{x:Static Properties:Resources.PictureSettingsView_Top}" />
- <controls:NumberBox Width="60" HorizontalAlignment="Left" Margin="0,0,0,5" IsEnabled="{Binding IsCustomCrop}" Grid.Row="3" Grid.Column="2"
- Minimum="0" Modulus="2" Number="{Binding CropBottom, Mode=TwoWay}" UpdateBindingOnTextChange="True" ShowIncrementButtons="True" AllowEmpty="False"
+ <controls:NumberBox Width="60" HorizontalAlignment="Left" Margin="0,0,0,5" IsEnabled="{Binding PaddingFilter.IsCustomPaddingEnabled}" Grid.Row="3" Grid.Column="2"
+ Minimum="0" Modulus="2" Number="{Binding PaddingFilter.Bottom, Mode=TwoWay}" UpdateBindingOnTextChange="True" ShowIncrementButtons="True" AllowEmpty="False"
ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_CropBottom}"
AutomationProperties.Name="{x:Static Properties:Resources.PictureSettingsView_Bottom}" />
- <controls:NumberBox Width="60" HorizontalAlignment="Left" Margin="0,0,0,5" IsEnabled="{Binding IsCustomCrop}" Grid.Row="2" Grid.Column="1"
- Minimum="0" Modulus="2" Number="{Binding CropLeft, Mode=TwoWay}" UpdateBindingOnTextChange="True" ShowIncrementButtons="True" AllowEmpty="False"
+ <controls:NumberBox Width="60" HorizontalAlignment="Left" Margin="0,0,0,5" IsEnabled="{Binding PaddingFilter.IsCustomPaddingEnabled}" Grid.Row="2" Grid.Column="1"
+ Minimum="0" Modulus="2" Number="{Binding PaddingFilter.Left, Mode=TwoWay}" UpdateBindingOnTextChange="True" ShowIncrementButtons="True" AllowEmpty="False"
ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_CropLeft}"
AutomationProperties.Name="{x:Static Properties:Resources.PictureSettingsView_Left}"/>
- <controls:NumberBox Width="60" HorizontalAlignment="Left" Margin="0,0,0,5" IsEnabled="{Binding IsCustomCrop}" Grid.Row="2" Grid.Column="3"
- Minimum="0" Modulus="2" Number="{Binding CropRight, Mode=TwoWay}" UpdateBindingOnTextChange="True" ShowIncrementButtons="True" AllowEmpty="False"
+ <controls:NumberBox Width="60" HorizontalAlignment="Left" Margin="0,0,0,5" IsEnabled="{Binding PaddingFilter.IsCustomPaddingEnabled}" Grid.Row="2" Grid.Column="3"
+ Minimum="0" Modulus="2" Number="{Binding PaddingFilter.Right, Mode=TwoWay}" UpdateBindingOnTextChange="True" ShowIncrementButtons="True" AllowEmpty="False"
ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_CropRight}"
AutomationProperties.Name="{x:Static Properties:Resources.PictureSettingsView_Right}"/>
-
</Grid>
<TextBlock Text="{x:Static Properties:Resources.PictureSettingsView_PaddingColour}" Grid.Row="2" Grid.Column="0" />
- <ComboBox ItemsSource="{Binding PaddingFilter.PaddingColours}" SelectedItem="{Binding PaddingFilter.Colour}" Grid.Row="2" Grid.Column="1" />
+ <ComboBox ItemsSource="{Binding PaddingFilter.PaddingColours}" SelectedItem="{Binding PaddingFilter.Colour}" Grid.Row="2" Grid.Column="1" Width="120"
+ IsEnabled="{Binding PaddingFilter.IsCustomPaddingEnabled}" />
- </Grid> -->
+ <TextBlock Text="{x:Static Properties:Resources.PictureSettingsView_PaddingCustomColour}" Grid.Row="3" Grid.Column="0" Visibility="{Binding PaddingFilter.IsCustomColourVisible, Converter={StaticResource boolToVisConverter}}" />
+ <TextBox Text="{Binding PaddingFilter.CustomColour, UpdateSourceTrigger=PropertyChanged}" Grid.Row="3" Grid.Column="1" Width="120" Visibility="{Binding PaddingFilter.IsCustomColourVisible, Converter={StaticResource boolToVisConverter}}"
+ ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_PaddingCustomColourTooltip}"/>
+
+ </Grid>
<!-- Preview Control -->
<Grid Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="3">