diff options
author | sr55 <[email protected]> | 2020-05-17 20:11:25 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2020-05-17 20:11:37 +0100 |
commit | f2e3c5d7dbe55cbebfa993912e65e4a21a63272b (patch) | |
tree | 7cf03cae435eb07e33ba04b8349fb1ec7546e42f | |
parent | 20cb33eb66fb4160d57444996877c4d9783e34ed (diff) |
WinGui: Lay the ground work for adding the padding filter to the Windows UI. Minor UI tweaks on the Picture settings tab including moving the Rotate/Flip filter onto this tab. #2437
17 files changed, 658 insertions, 733 deletions
diff --git a/win/CS/HandBrake.Interop/Interop/Model/Encoding/PaddingFilter.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/PaddingFilter.cs new file mode 100644 index 000000000..305773dae --- /dev/null +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/PaddingFilter.cs @@ -0,0 +1,22 @@ +// -------------------------------------------------------------------------------------------------------------------- +// <copyright file="PaddingFilter.cs" company="HandBrake Project (https://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 PaddingFilter type. +// </summary> +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Model.Encoding +{ + public class PaddingFilter + { + public bool Enabled { get; set; } + + public string Color { get; set; } + + public int X { get; set; } + + public int Y { get; set; } + } +} diff --git a/win/CS/HandBrake.sln.DotSettings b/win/CS/HandBrake.sln.DotSettings index f506f6b7c..d8ac48dec 100644 --- a/win/CS/HandBrake.sln.DotSettings +++ b/win/CS/HandBrake.sln.DotSettings @@ -1413,4 +1413,5 @@ <s:String x:Key="/Default/Housekeeping/VsSavedAutocompletionValue/OverrideParameterInfo/=Xaml/@EntryIndexedValue">NotOverridden</s:String> <s:Int64 x:Key="/Default/OptionsGeneral/AutoDeleteWorkspaceOlderNDays/@EntryValue">10</s:Int64> <s:String x:Key="/Default/SnapshotsStore/CurrentStore/@EntryValue">C:\Users\Scott\AppData\Local\JetBrains\Shared\vAny\Sessions</s:String> - <s:Int64 x:Key="/Default/StyleCopOptions/ParsingPerformance/@EntryValue">8</s:Int64></wpf:ResourceDictionary>
\ No newline at end of file + <s:Int64 x:Key="/Default/StyleCopOptions/ParsingPerformance/@EntryValue">8</s:Int64> + <s:Boolean x:Key="/Default/UserDictionary/Words/=Colours/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/Model/Filters/PaddingMode.cs b/win/CS/HandBrakeWPF/Model/Filters/PaddingMode.cs new file mode 100644 index 000000000..63323c4bb --- /dev/null +++ b/win/CS/HandBrakeWPF/Model/Filters/PaddingMode.cs @@ -0,0 +1,38 @@ +// -------------------------------------------------------------------------------------------------------------------- +// <copyright file="PaddingMode.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 PaddingMode type. +// </summary> +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrakeWPF.Model.Filters +{ + using HandBrake.Interop.Attributes; + + using HandBrakeWPF.Properties; + + public enum PaddingMode + { + [DisplayName(typeof(Resources), "PaddingMode_None")] + [ShortName("none")] + None = 0, + + [DisplayName(typeof(Resources), "PaddingMode_Fill")] + [ShortName("fill")] + FirstMatch, + + [DisplayName(typeof(Resources), "PaddingMode_Width")] + [ShortName("width")] + Width, + + [DisplayName(typeof(Resources), "PaddingMode_Height")] + [ShortName("height")] + Height, + + [DisplayName(typeof(Resources), "PaddingMode_Custom")] + [ShortName("custom")] + Custom, + } +} diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs index 4aa7da33e..249f7d5f5 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs @@ -3782,6 +3782,51 @@ namespace HandBrakeWPF.Properties { } /// <summary> + /// Looks up a localized string similar to Custom (Not Limited). + /// </summary> + public static string PaddingMode_Custom { + get { + return ResourceManager.GetString("PaddingMode_Custom", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Fill (pad to resolution limit). + /// </summary> + public static string PaddingMode_Fill { + get { + return ResourceManager.GetString("PaddingMode_Fill", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Height (pad up to res limit). + /// </summary> + public static string PaddingMode_Height { + get { + return ResourceManager.GetString("PaddingMode_Height", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to None. + /// </summary> + public static string PaddingMode_None { + get { + return ResourceManager.GetString("PaddingMode_None", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Width (pad up to res limit). + /// </summary> + public static string PaddingMode_Width { + get { + return ResourceManager.GetString("PaddingMode_Width", resourceCulture); + } + } + + /// <summary> /// Looks up a localized string similar to Queue Paused. Warning, the drive you are encoding to is low on disk space. Please free up some space and press start to continue. You can also adjust the minimum space level in preferences.. /// </summary> public static string PauseOnLowDiskspace { @@ -3818,6 +3863,15 @@ namespace HandBrakeWPF.Properties { } /// <summary> + /// Looks up a localized string similar to Borders. + /// </summary> + public static string PictureSettingsView_Borders { + get { + return ResourceManager.GetString("PictureSettingsView_Borders", resourceCulture); + } + } + + /// <summary> /// Looks up a localized string similar to Bottom. /// </summary> public static string PictureSettingsView_Bottom { @@ -3827,7 +3881,7 @@ namespace HandBrakeWPF.Properties { } /// <summary> - /// Looks up a localized string similar to Cropping. + /// Looks up a localized string similar to Cropping:. /// </summary> public static string PictureSettingsView_Cropping { get { @@ -3899,6 +3953,24 @@ namespace HandBrakeWPF.Properties { } /// <summary> + /// Looks up a localized string similar to Padding:. + /// </summary> + public static string PictureSettingsView_Padding { + get { + return ResourceManager.GetString("PictureSettingsView_Padding", resourceCulture); + } + } + + /// <summary> + /// Looks up a localized string similar to Padding Colour:. + /// </summary> + public static string PictureSettingsView_PaddingColour { + get { + return ResourceManager.GetString("PictureSettingsView_PaddingColour", resourceCulture); + } + } + + /// <summary> /// Looks up a localized string similar to PAR:. /// </summary> public static string PictureSettingsView_PAR { @@ -3908,6 +3980,15 @@ namespace HandBrakeWPF.Properties { } /// <summary> + /// Looks up a localized string similar to Resolution and Scaling. + /// </summary> + public static string PictureSettingsView_ResAndScaling { + get { + return ResourceManager.GetString("PictureSettingsView_ResAndScaling", resourceCulture); + } + } + + /// <summary> /// Looks up a localized string similar to Right. /// </summary> public static string PictureSettingsView_Right { @@ -3917,6 +3998,15 @@ namespace HandBrakeWPF.Properties { } /// <summary> + /// Looks up a localized string similar to Rotate and Crop. + /// </summary> + public static string PictureSettingsView_RotateAndCrop { + get { + return ResourceManager.GetString("PictureSettingsView_RotateAndCrop", resourceCulture); + } + } + + /// <summary> /// Looks up a localized string similar to Size. /// </summary> public static string PictureSettingsView_Size { diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx index 925e1b6ed..e873ff6f6 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.resx +++ b/win/CS/HandBrakeWPF/Properties/Resources.resx @@ -1326,7 +1326,7 @@ Would you like to overwrite it?</value> <value>Bottom</value>
</data>
<data name="PictureSettingsView_Cropping" xml:space="preserve">
- <value>Cropping</value>
+ <value>Cropping:</value>
</data>
<data name="PictureSettingsView_Custom" xml:space="preserve">
<value>Custom</value>
@@ -2238,4 +2238,25 @@ Please choose a different preset.</value> <data name="OptionsViewModel_ResetHandBrakeQuestion" xml:space="preserve">
<value>Are you sure you wish to reset HandBrake to default settings?</value>
</data>
+ <data name="PaddingMode_Custom" xml:space="preserve">
+ <value>Custom (Not Limited)</value>
+ </data>
+ <data name="PaddingMode_Fill" xml:space="preserve">
+ <value>Fill (pad to resolution limit)</value>
+ </data>
+ <data name="PaddingMode_Height" xml:space="preserve">
+ <value>Height (pad up to res limit)</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>
+ </data>
+ <data name="PictureSettingsView_Padding" xml:space="preserve">
+ <value>Padding:</value>
+ </data>
+ <data name="PictureSettingsView_PaddingColour" xml:space="preserve">
+ <value>Padding Colour:</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 eab326930..ea8c0cd41 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeTaskFactory.cs @@ -24,6 +24,7 @@ namespace HandBrakeWPF.Services.Encode.Factories using HandBrake.Interop.Model; using HandBrakeWPF.Helpers; + using HandBrakeWPF.Model.Filters; using HandBrakeWPF.Utilities; using Newtonsoft.Json.Linq; @@ -560,6 +561,25 @@ namespace HandBrakeWPF.Services.Encode.Factories filter.FilterList.Add(cropScale); } + // 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); + IntPtr padSettingsPtr = hbFunctions.hb_generate_filter_settings_json((int)hb_filter_ids.HB_FILTER_PAD, null, null, padSettings); + string unparsedPadSettingsJson = Marshal.PtrToStringAnsi(padSettingsPtr); + if (!string.IsNullOrEmpty(unparsedPadSettingsJson)) + { + JToken PadSettingsJson = JObject.Parse(unparsedPadSettingsJson); + + Filter padding = new Filter + { + ID = (int)hb_filter_ids.HB_FILTER_PAD, + Settings = PadSettingsJson + }; + filter.FilterList.Add(padding); + } + } + // Grayscale if (job.Grayscale) { diff --git a/win/CS/HandBrakeWPF/Services/Encode/Model/EncodeTask.cs b/win/CS/HandBrakeWPF/Services/Encode/Model/EncodeTask.cs index 56a45ba9e..710127d0c 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Model/EncodeTask.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Model/EncodeTask.cs @@ -18,8 +18,6 @@ namespace HandBrakeWPF.Services.Encode.Model using HandBrakeWPF.Model.Filters; using HandBrakeWPF.Services.Encode.Model.Models; - using Newtonsoft.Json; - using AllowedPassthru = Models.AllowedPassthru; using AudioTrack = Models.AudioTrack; using ChapterMarker = Models.ChapterMarker; @@ -45,17 +43,11 @@ namespace HandBrakeWPF.Services.Encode.Model this.AllowedPassthruOptions = new AllowedPassthru(); this.Modulus = 16; this.MetaData = new MetaData(); + this.Padding = new PaddingFilter(); this.VideoTunes = new List<VideoTune>(); } - /// <summary> - /// Initializes a new instance of the <see cref="EncodeTask"/> class. - /// Copy Constructor - /// </summary> - /// <param name="task"> - /// The task. - /// </param> public EncodeTask(EncodeTask task) { this.AllowedPassthruOptions = new AllowedPassthru(task.AllowedPassthruOptions); @@ -98,6 +90,7 @@ namespace HandBrakeWPF.Services.Encode.Model this.SharpenPreset = task.SharpenPreset; this.SharpenTune = task.SharpenTune; this.SharpenCustom = task.SharpenCustom; + this.Padding = task.Padding; this.DisplayWidth = task.DisplayWidth; this.EndPoint = task.EndPoint; @@ -144,353 +137,165 @@ namespace HandBrakeWPF.Services.Encode.Model this.MetaData = new MetaData(task.MetaData); } - #region Source + /* Source */ - /// <summary> - /// Gets or sets Source. - /// </summary> public string Source { get; set; } - /// <summary> - /// Gets or sets Title. - /// </summary> public int Title { get; set; } - /// <summary> - /// Gets or sets the Angle - /// </summary> public int Angle { get; set; } - /// <summary> - /// Gets or sets PointToPointMode. - /// </summary> public PointToPointMode PointToPointMode { get; set; } - /// <summary> - /// Gets or sets StartPoint. - /// </summary> public long StartPoint { get; set; } - /// <summary> - /// Gets or sets EndPoint. - /// </summary> public long EndPoint { get; set; } - #endregion - - #region Destination + /* Destination */ - /// <summary> - /// Gets or sets Destination. - /// </summary> public string Destination { get; set; } - #endregion + /* Output Settings */ - #region Output Settings - - /// <summary> - /// Gets or sets OutputFormat. - /// </summary> public OutputFormat OutputFormat { get; set; } - /// <summary> - /// Gets or sets a value indicating whether Optimize. - /// </summary> public bool OptimizeMP4 { get; set; } - /// <summary> - /// Gets or sets a value indicating whether IPod5GSupport. - /// </summary> public bool IPod5GSupport { get; set; } public bool AlignAVStart { get; set; } + + /* Picture Settings */ - #endregion - - #region Picture - - /// <summary> - /// Gets or sets Width. - /// </summary> public int? Width { get; set; } - /// <summary> - /// Gets or sets Height. - /// </summary> public int? Height { get; set; } - /// <summary> - /// Gets or sets MaxWidth. - /// </summary> public int? MaxWidth { get; set; } - /// <summary> - /// Gets or sets MaxHeight. - /// </summary> public int? MaxHeight { get; set; } - /// <summary> - /// Gets or sets Cropping. - /// </summary> public Cropping Cropping { get; set; } - /// <summary> - /// Gets or sets a value indicating whether HasCropping. - /// </summary> public bool HasCropping { get; set; } - /// <summary> - /// Gets or sets Anamorphic. - /// </summary> public Anamorphic Anamorphic { get; set; } - /// <summary> - /// Gets or sets DisplayWidth. - /// </summary> public double? DisplayWidth { get; set; } - /// <summary> - /// Gets or sets a value indicating whether KeepDisplayAspect. - /// </summary> public bool KeepDisplayAspect { get; set; } - /// <summary> - /// Gets or sets PixelAspectX. - /// </summary> public int PixelAspectX { get; set; } - /// <summary> - /// Gets or sets PixelAspectY. - /// </summary> public int PixelAspectY { get; set; } - /// <summary> - /// Gets or sets Modulus. - /// </summary> public int? Modulus { get; set; } - #endregion - #region Filters + /* Filters */ - /// <summary> - /// Gets or sets Deinterlace Filter Mode - /// </summary> public DeinterlaceFilter DeinterlaceFilter { get; set; } - /// <summary> - /// Gets or sets Deinterlace. - /// </summary> public HBPresetTune DeinterlacePreset { get; set; } - /// <summary> - /// Gets or sets the comb detect. - /// </summary> public CombDetect CombDetect { get; set; } - /// <summary> - /// Gets or sets CustomDecomb. - /// </summary> public string CustomDeinterlaceSettings { get; set; } - /// <summary> - /// Gets or sets the custom comb detect. - /// </summary> public string CustomCombDetect { get; set; } - /// <summary> - /// Gets or sets Detelecine. - /// </summary> public Detelecine Detelecine { get; set; } - /// <summary> - /// Gets or sets CustomDetelecine. - /// </summary> public string CustomDetelecine { get; set; } - /// <summary> - /// Gets or sets Denoise. - /// </summary> public Denoise Denoise { get; set; } - /// <summary> - /// Gets or sets the denoise preset. - /// </summary> public DenoisePreset DenoisePreset { get; set; } - /// <summary> - /// Gets or sets the denoise tune. - /// </summary> public DenoiseTune DenoiseTune { get; set; } - /// <summary> - /// Gets or sets CustomDenoise. - /// </summary> public string CustomDenoise { get; set; } - /// <summary> - /// Gets or sets a value indicating whether Grayscale. - /// </summary> public bool Grayscale { get; set; } - /// <summary> - /// Rotate the Video by x Degrees - /// </summary> public int Rotation { get; set; } - /// <summary> - /// Flip the video. - /// </summary> public bool FlipVideo { get; set; } public Sharpen Sharpen { get; set; } + public FilterPreset SharpenPreset { get; set; } + public FilterTune SharpenTune { get; set; } + public string SharpenCustom { get; set; } public FilterPreset DeblockPreset { get; set; } + public FilterTune DeblockTune { get; set; } + public string CustomDeblock { get; set; } - #endregion - #region Video + public PaddingFilter Padding { get; set; } + + /* Video */ - /// <summary> - /// Gets or sets VideoEncodeRateType. - /// </summary> public VideoEncodeRateType VideoEncodeRateType { get; set; } - /// <summary> - /// Gets or sets the VideoEncoder - /// </summary> public VideoEncoder VideoEncoder { get; set; } - /// <summary> - /// Gets or sets the video profile. - /// </summary> public VideoProfile VideoProfile { get; set; } - /// <summary> - /// Gets or sets the video level. - /// </summary> public VideoLevel VideoLevel { get; set; } - /// <summary> - /// Gets or sets the video preset. - /// </summary> public VideoPreset VideoPreset { get; set; } - /// <summary> - /// Gets or sets the video tunes. - /// </summary> public List<VideoTune> VideoTunes { get; set; } - /// <summary> - /// Gets or sets Extra Advanced Arguments for the Video Tab. - /// </summary> public string ExtraAdvancedArguments { get; set; } - /// <summary> - /// Gets or sets the Video Encode Mode - /// </summary> public FramerateMode FramerateMode { get; set; } - /// <summary> - /// Gets or sets Quality. - /// </summary> public double? Quality { get; set; } - /// <summary> - /// Gets or sets VideoBitrate. - /// </summary> public int? VideoBitrate { get; set; } - /// <summary> - /// Gets or sets a value indicating whether TwoPass. - /// </summary> public bool TwoPass { get; set; } - /// <summary> - /// Gets or sets a value indicating whether TurboFirstPass. - /// </summary> public bool TurboFirstPass { get; set; } - /// <summary> - /// Gets or sets Framerate. - /// Null = Same as Source - /// </summary> public double? Framerate { get; set; } - #endregion - #region Audio + /* Audio */ - /// <summary> - /// Gets or sets AudioEncodings. - /// </summary> public ObservableCollection<AudioTrack> AudioTracks { get; set; } - /// <summary> - /// Gets or sets AllowedPassthruOptions. - /// </summary> public AllowedPassthru AllowedPassthruOptions { get; set; } - #endregion + /* Subtitles */ - #region Subtitles - - /// <summary> - /// Gets or sets SubtitleTracks. - /// </summary> public ObservableCollection<SubtitleTrack> SubtitleTracks { get; set; } + + /* Chapters */ - #endregion - - #region Chapters - - /// <summary> - /// Gets or sets a value indicating whether IncludeChapterMarkers. - /// </summary> public bool IncludeChapterMarkers { get; set; } - /// <summary> - /// Gets or sets ChapterMarkersFilePath. - /// </summary> public string ChapterMarkersFilePath { get; set; } - /// <summary> - /// Gets or sets ChapterNames. - /// </summary> public ObservableCollection<ChapterMarker> ChapterNames { get; set; } - #endregion - - #region MetaData - /// <summary> - /// Gets or sets the meta data. - /// </summary> + /* Metadata */ + public MetaData MetaData { get; set; } - #endregion - #region Preview + /* Previews */ - /// <summary> - /// Gets or sets a value indicating whether IsPreviewEncode. - /// </summary> public bool IsPreviewEncode { get; set; } - /// <summary> - /// Gets or sets PreviewEncodeDuration. - /// </summary> public int? PreviewEncodeDuration { get; set; } - /// <summary> - /// Gets or sets PreviewEncodeStartAt. - /// </summary> public int? PreviewEncodeStartAt { get; set; } - - #endregion } } diff --git a/win/CS/HandBrakeWPF/ViewModelItems/Filters/PadFilter.cs b/win/CS/HandBrakeWPF/ViewModelItems/Filters/PadFilter.cs new file mode 100644 index 000000000..26d35d8ed --- /dev/null +++ b/win/CS/HandBrakeWPF/ViewModelItems/Filters/PadFilter.cs @@ -0,0 +1,144 @@ +// -------------------------------------------------------------------------------------------------------------------- +// <copyright file="DeblockFilter.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 HandBrake.Interop.Interop.Model.Encoding; + + 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; + + using Action = System.Action; + + public class PadFilter : PropertyChangedBase + { + private readonly Action triggerTabChanged; + + public PadFilter(EncodeTask currentTask, Action triggerTabChanged) + { + this.triggerTabChanged = triggerTabChanged; + this.CurrentTask = currentTask; + } + + public EncodeTask CurrentTask { get; private set; } + + public IEnumerable<PaddingMode> PaddingModes => EnumHelper<PaddingMode>.GetEnumList(); + + public PaddingMode Mode { get; set; } + + public IEnumerable<string> PaddingColours { get; } = new List<string>() { "Black", "White", "Custom" }; + + public int X + { + get + { + return this.CurrentTask.Padding.X; + } + + set + { + this.CurrentTask.Padding.X = value; + this.NotifyOfPropertyChange(() => this.X); + this.triggerTabChanged(); + } + } + + public int Y + { + get + { + return this.CurrentTask.Padding.Y; + } + + set + { + this.CurrentTask.Padding.Y = value; + this.NotifyOfPropertyChange(() => this.Y); + this.triggerTabChanged(); + } + } + + public string Colour + { + get + { + return this.CurrentTask.Padding.Color; + } + + set + { + this.CurrentTask.Padding.Color = value; + this.NotifyOfPropertyChange(() => this.Colour); + this.triggerTabChanged(); + } + } + + public void SetPreset(Preset preset, EncodeTask task) + { + this.CurrentTask = task; + + if (preset == null) + { + return; + } + + this.NotifyOfPropertyChange(() => this.X); + this.NotifyOfPropertyChange(() => this.Y); + this.NotifyOfPropertyChange(() => this.Colour); + } + + public void UpdateTask(EncodeTask task) + { + this.CurrentTask = task; + } + + public bool MatchesPreset(Preset preset) + { + if (preset.Task.Padding.Enabled && Mode != PaddingMode.None) + { + return false; + } + + if (preset.Task.Padding.X != this.X) + { + return false; + } + + if (preset.Task.Padding.Y != this.Y) + { + return false; + } + + if (preset.Task.Padding.Color != this.Colour) + { + return false; + } + + return true; + } + + public void SetSource(Source source, Title title, Preset preset, EncodeTask task) + { + this.CurrentTask = task; + } + } +} diff --git a/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs index d2c1899c6..f43bb6af5 100644 --- a/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs @@ -10,34 +10,19 @@ namespace HandBrakeWPF.ViewModels
{
using System;
- 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 HandBrake.Interop.Interop.Model.Encoding;
using HandBrakeWPF.EventArgs;
- using HandBrakeWPF.Model.Filters;
using HandBrakeWPF.Services.Interfaces;
using HandBrakeWPF.Services.Presets.Model;
using HandBrakeWPF.Services.Scan.Model;
- using HandBrakeWPF.Utilities;
using HandBrakeWPF.ViewModelItems.Filters;
using HandBrakeWPF.ViewModels.Interfaces;
using EncodeTask = HandBrakeWPF.Services.Encode.Model.EncodeTask;
- /// <summary>
- /// The Filters View Model
- /// </summary>
public class FiltersViewModel : ViewModelBase, IFiltersViewModel
{
- public FiltersViewModel(IWindowManager windowManager, IUserSettingService userSettingService)
+ public FiltersViewModel(IUserSettingService userSettingService)
{
this.CurrentTask = new EncodeTask();
@@ -46,7 +31,6 @@ namespace HandBrakeWPF.ViewModels this.DetelecineFilter = new DetelecineItem(this.CurrentTask, () => this.OnTabStatusChanged(null));
this.DeinterlaceFilter = new DeinterlaceFilterItem(this.CurrentTask, () => this.OnTabStatusChanged(null));
this.DeblockFilter = new DeblockFilter(this.CurrentTask, () => this.OnTabStatusChanged(null));
- this.RotateFlipFilter = new RotateFlipFilter(this.CurrentTask, () => this.OnTabStatusChanged(null));
this.GrayscaleFilter = new GrayscaleFilter(this.CurrentTask, () => this.OnTabStatusChanged(null));
}
@@ -64,8 +48,6 @@ namespace HandBrakeWPF.ViewModels public DeblockFilter DeblockFilter { get; set; }
- public RotateFlipFilter RotateFlipFilter { get; set; }
-
public GrayscaleFilter GrayscaleFilter { get; set; }
public void SetPreset(Preset preset, EncodeTask task)
@@ -77,7 +59,6 @@ namespace HandBrakeWPF.ViewModels this.DetelecineFilter.SetPreset(preset, task);
this.DeinterlaceFilter.SetPreset(preset, task);
this.DeblockFilter.SetPreset(preset, task);
- this.RotateFlipFilter.SetPreset(preset, task);
}
public void UpdateTask(EncodeTask task)
@@ -89,7 +70,6 @@ namespace HandBrakeWPF.ViewModels this.DetelecineFilter.UpdateTask(task);
this.DeinterlaceFilter.UpdateTask(task);
this.DeblockFilter.UpdateTask(task);
- this.RotateFlipFilter.UpdateTask(task);
this.GrayscaleFilter.UpdateTask(task);
}
@@ -120,11 +100,6 @@ namespace HandBrakeWPF.ViewModels return false;
}
- if (!this.RotateFlipFilter.MatchesPreset(preset))
- {
- return false;
- }
-
if (!this.GrayscaleFilter.MatchesPreset(preset))
{
return false;
@@ -141,7 +116,6 @@ namespace HandBrakeWPF.ViewModels this.DetelecineFilter.SetSource(source, title, preset, task);
this.DeinterlaceFilter.SetSource(source, title, preset, task);
this.DeblockFilter.SetSource(source, title, preset, task);
- this.RotateFlipFilter.SetSource(source, title, preset, task);
this.GrayscaleFilter.SetSource(source, title, preset, task);
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs index c8b85d7e6..b6a1705d5 100644 --- a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs @@ -23,147 +23,56 @@ namespace HandBrakeWPF.ViewModels using HandBrakeWPF.Services.Presets.Model;
using HandBrakeWPF.Services.Scan.Model;
using HandBrakeWPF.Utilities;
+ using HandBrakeWPF.ViewModelItems.Filters;
using HandBrakeWPF.ViewModels.Interfaces;
using EncodeTask = HandBrakeWPF.Services.Encode.Model.EncodeTask;
using PresetPictureSettingsMode = HandBrakeWPF.Model.Picture.PresetPictureSettingsMode;
- /// <summary>
- /// The Picture Settings View Model
- /// </summary>
public class PictureSettingsViewModel : ViewModelBase, IPictureSettingsViewModel
{
- /*
- * TODO:
- * - We are not handling cropping correctly within the UI.
- * - The Height is not correctly set when using no Anamorphic
- * - Maintain Aspect ratio needs corrected.
- * - Custom Anamorphic.
- *
- */
- #region Constants and Fields
-
- /// <summary>
- /// The display size.
- /// </summary>
private string displaySize;
-
- /// <summary>
- /// Backing field for for height control enabled
- /// </summary>
private bool heightControlEnabled = true;
-
- /// <summary>
- /// Backing field for show custom anamorphic controls
- /// </summary>
private bool showCustomAnamorphicControls;
-
- /// <summary>
- /// The source info.
- /// </summary>
private string sourceInfo;
-
- /// <summary>
- /// Source Par Values
- /// </summary>
private Size sourceParValues;
-
- /// <summary>
- /// Source Resolution
- /// </summary>
private Size sourceResolution;
-
- /// <summary>
- /// Backing field for width control enabled.
- /// </summary>
private bool widthControlEnabled = true;
-
- /// <summary>
- /// Backing field for the show modulus field
- /// </summary>
private bool showModulus;
-
- /// <summary>
- /// Backing field for showing display size.
- /// </summary>
private bool showDisplaySize;
-
- /// <summary>
- /// Backing field for max height
- /// </summary>
private int maxHeight;
-
- /// <summary>
- /// Backing field for max width
- /// </summary>
private int maxWidth;
-
- /// <summary>
- /// The show keep ar backing field.
- /// </summary>
private bool showKeepAr = true;
- /// <summary>
- /// The delayed previewprocessor.
- /// </summary>
private DelayedActionProcessor delayedPreviewprocessor = new DelayedActionProcessor();
-
- /// <summary>
- /// The current title.
- /// </summary>
private Title currentTitle;
-
- /// <summary>
- /// The scanned source.
- /// </summary>
private Source scannedSource;
- #endregion
-
- #region Constructors and Destructors
-
- /// <summary>
- /// Initializes a new instance of the <see cref="HandBrakeWPF.ViewModels.PictureSettingsViewModel"/> class.
- /// </summary>
public PictureSettingsViewModel(IStaticPreviewViewModel staticPreviewViewModel)
{
this.StaticPreviewViewModel = staticPreviewViewModel;
this.sourceResolution = new Size(0, 0);
this.Task = new EncodeTask();
+ this.PaddingFilter = new PadFilter(this.Task, () => this.OnTabStatusChanged(null));
+ this.RotateFlipFilter = new RotateFlipFilter(this.Task, () => this.OnTabStatusChanged(null));
this.Init();
}
- #endregion
-
public event EventHandler<TabStatusEventArgs> TabStatusChanged;
- #region Properties
+ /* Properties */
- /// <summary>
- /// Gets or sets the static preview view model.
- /// </summary>
public IStaticPreviewViewModel StaticPreviewViewModel { get; set; }
- /// <summary>
- /// Gets AnamorphicModes.
- /// </summary>
- public IEnumerable<Anamorphic> AnamorphicModes
- {
- get
- {
- return new List<Anamorphic> { Anamorphic.None, Anamorphic.Automatic, Anamorphic.Loose, Anamorphic.Custom };
- }
- }
+ public IEnumerable<Anamorphic> AnamorphicModes { get; } = new List<Anamorphic> { Anamorphic.None, Anamorphic.Automatic, Anamorphic.Loose, Anamorphic.Custom };
+
+ public PadFilter PaddingFilter { get; set; }
+
+ public RotateFlipFilter RotateFlipFilter { get; set; }
- /// <summary>
- /// Gets or sets DisplaySize.
- /// </summary>
public string DisplaySize
{
- get
- {
- return this.displaySize;
- }
+ get => this.displaySize;
set
{
@@ -172,15 +81,9 @@ namespace HandBrakeWPF.ViewModels }
}
- /// <summary>
- /// Gets or sets a value indicating whether HeightControlEnabled.
- /// </summary>
public bool HeightControlEnabled
{
- get
- {
- return this.heightControlEnabled;
- }
+ get => this.heightControlEnabled;
set
{
@@ -189,26 +92,11 @@ namespace HandBrakeWPF.ViewModels }
}
- /// <summary>
- /// Gets ModulusValues.
- /// </summary>
- public IEnumerable<int> ModulusValues
- {
- get
- {
- return new List<int> { 16, 8, 4, 2 };
- }
- }
+ public IEnumerable<int> ModulusValues { get; } = new List<int> { 16, 8, 4, 2 };
- /// <summary>
- /// Gets or sets a value indicating whether ShowCustomAnamorphicControls.
- /// </summary>
public bool ShowCustomAnamorphicControls
{
- get
- {
- return this.showCustomAnamorphicControls;
- }
+ get => this.showCustomAnamorphicControls;
set
{
@@ -217,15 +105,9 @@ namespace HandBrakeWPF.ViewModels }
}
- /// <summary>
- /// Gets or sets SourceInfo.
- /// </summary>
public string SourceInfo
{
- get
- {
- return this.sourceInfo;
- }
+ get => this.sourceInfo;
set
{
@@ -234,20 +116,11 @@ namespace HandBrakeWPF.ViewModels }
}
- /// <summary>
- /// Gets or sets Task.
- /// </summary>
public EncodeTask Task { get; set; }
- /// <summary>
- /// Gets or sets a value indicating whether WidthControlEnabled.
- /// </summary>
public bool WidthControlEnabled
{
- get
- {
- return this.widthControlEnabled;
- }
+ get => this.widthControlEnabled;
set
{
@@ -256,15 +129,9 @@ namespace HandBrakeWPF.ViewModels }
}
- /// <summary>
- /// Gets or sets a value indicating whether ShowModulus.
- /// </summary>
public bool ShowModulus
{
- get
- {
- return this.showModulus;
- }
+ get => this.showModulus;
set
{
this.showModulus = value;
@@ -272,15 +139,9 @@ namespace HandBrakeWPF.ViewModels }
}
- /// <summary>
- /// Gets or sets a value indicating whether ShowDisplaySize.
- /// </summary>
public bool ShowDisplaySize
{
- get
- {
- return this.showDisplaySize;
- }
+ get => this.showDisplaySize;
set
{
this.showDisplaySize = value;
@@ -288,15 +149,9 @@ namespace HandBrakeWPF.ViewModels }
}
- /// <summary>
- /// Gets or sets MaxHeight.
- /// </summary>
public int MaxHeight
{
- get
- {
- return this.maxHeight;
- }
+ get => this.maxHeight;
set
{
this.maxHeight = value;
@@ -304,15 +159,9 @@ namespace HandBrakeWPF.ViewModels }
}
- /// <summary>
- /// Gets or sets MinHeight.
- /// </summary>
public int MaxWidth
{
- get
- {
- return this.maxWidth;
- }
+ get => this.maxWidth;
set
{
this.maxWidth = value;
@@ -320,15 +169,9 @@ namespace HandBrakeWPF.ViewModels }
}
- /// <summary>
- /// Gets or sets a value indicating whether show keep ar.
- /// </summary>
public bool ShowKeepAR
{
- get
- {
- return this.showKeepAr;
- }
+ get => this.showKeepAr;
set
{
this.showKeepAr = value;
@@ -336,19 +179,11 @@ namespace HandBrakeWPF.ViewModels }
}
- #endregion
+ /* Task Properties */
- #region Task Properties
-
- /// <summary>
- /// Gets or sets CropBottom.
- /// </summary>
public int CropBottom
{
- get
- {
- return this.Task.Cropping.Bottom;
- }
+ get => this.Task.Cropping.Bottom;
set
{
@@ -358,15 +193,9 @@ namespace HandBrakeWPF.ViewModels }
}
- /// <summary>
- /// Gets or sets CropLeft.
- /// </summary>
public int CropLeft
{
- get
- {
- return this.Task.Cropping.Left;
- }
+ get => this.Task.Cropping.Left;
set
{
@@ -376,15 +205,9 @@ namespace HandBrakeWPF.ViewModels }
}
- /// <summary>
- /// Gets or sets CropRight.
- /// </summary>
public int CropRight
{
- get
- {
- return this.Task.Cropping.Right;
- }
+ get => this.Task.Cropping.Right;
set
{
@@ -394,15 +217,9 @@ namespace HandBrakeWPF.ViewModels }
}
- /// <summary>
- /// Gets or sets CropTop.
- /// </summary>
public int CropTop
{
- get
- {
- return this.Task.Cropping.Top;
- }
+ get => this.Task.Cropping.Top;
set
{
@@ -412,15 +229,9 @@ namespace HandBrakeWPF.ViewModels }
}
- /// <summary>
- /// Gets or sets a value indicating whether IsCustomCrop.
- /// </summary>
public bool IsCustomCrop
{
- get
- {
- return this.Task.HasCropping;
- }
+ get => this.Task.HasCropping;
set
{
@@ -437,17 +248,9 @@ namespace HandBrakeWPF.ViewModels }
}
- /// <summary>
- /// Gets or sets DisplayWidth.
- /// </summary>
public long DisplayWidth
{
- get
- {
- return this.Task.DisplayWidth.HasValue
- ? int.Parse(Math.Round(this.Task.DisplayWidth.Value, 0).ToString(CultureInfo.InvariantCulture))
- : 0;
- }
+ get => this.Task.DisplayWidth.HasValue ? int.Parse(Math.Round(this.Task.DisplayWidth.Value, 0).ToString(CultureInfo.InvariantCulture)) : 0;
set
{
@@ -460,15 +263,9 @@ namespace HandBrakeWPF.ViewModels }
}
- /// <summary>
- /// Gets or sets Width.
- /// </summary>
public int Width
{
- get
- {
- return this.Task.Width.HasValue ? this.Task.Width.Value : 0;
- }
+ get => this.Task.Width.HasValue ? this.Task.Width.Value : 0;
set
{
@@ -481,15 +278,9 @@ namespace HandBrakeWPF.ViewModels }
}
- /// <summary>
- /// Gets or sets Height.
- /// </summary>
public int Height
{
- get
- {
- return this.Task.Height.HasValue ? this.Task.Height.Value : 0;
- }
+ get => this.Task.Height.HasValue ? this.Task.Height.Value : 0;
set
{
@@ -502,15 +293,9 @@ namespace HandBrakeWPF.ViewModels }
}
- /// <summary>
- /// Gets or sets a value indicating whether MaintainAspectRatio.
- /// </summary>
public bool MaintainAspectRatio
{
- get
- {
- return this.Task.KeepDisplayAspect;
- }
+ get => this.Task.KeepDisplayAspect;
set
{
@@ -520,15 +305,9 @@ namespace HandBrakeWPF.ViewModels }
}
- /// <summary>
- /// Gets or sets ParHeight.
- /// </summary>
public int ParHeight
{
- get
- {
- return this.Task.PixelAspectY;
- }
+ get => this.Task.PixelAspectY;
set
{
@@ -541,15 +320,9 @@ namespace HandBrakeWPF.ViewModels }
}
- /// <summary>
- /// Gets or sets ParWidth.
- /// </summary>
public int ParWidth
{
- get
- {
- return this.Task.PixelAspectX;
- }
+ get => this.Task.PixelAspectX;
set
{
@@ -562,15 +335,9 @@ namespace HandBrakeWPF.ViewModels }
}
- /// <summary>
- /// Gets or sets SelectedAnamorphicMode.
- /// </summary>
public Anamorphic SelectedAnamorphicMode
{
- get
- {
- return this.Task.Anamorphic;
- }
+ get => this.Task.Anamorphic;
set
{
@@ -584,15 +351,9 @@ namespace HandBrakeWPF.ViewModels }
}
- /// <summary>
- /// Gets or sets SelectedModulus.
- /// </summary>
public int? SelectedModulus
{
- get
- {
- return this.Task.Modulus;
- }
+ get => this.Task.Modulus;
set
{
@@ -603,19 +364,8 @@ namespace HandBrakeWPF.ViewModels }
}
- #endregion
-
- #region Public Methods
+ /* Public Tab API Implementation */
- /// <summary>
- /// Setup this tab for the specified preset.
- /// </summary>
- /// <param name="preset">
- /// The preset.
- /// </param>
- /// <param name="task">
- /// The task.
- /// </param>
public void SetPreset(Preset preset, EncodeTask task)
{
this.Task = task;
@@ -645,7 +395,10 @@ namespace HandBrakeWPF.ViewModels this.IsCustomCrop = false;
}
-
+ // Padding
+ this.PaddingFilter.SetPreset(preset, task);
+ this.RotateFlipFilter?.SetPreset(preset, task);
+
// Setup the Picture Sizes
switch (preset.PictureSettingsMode)
{
@@ -673,7 +426,6 @@ namespace HandBrakeWPF.ViewModels }
else
{
-
int presetWidth = preset.Task.MaxWidth ?? this.sourceResolution.Width;
int presetHeight = preset.Task.MaxHeight ?? this.sourceResolution.Height;
@@ -726,15 +478,12 @@ namespace HandBrakeWPF.ViewModels this.UpdateVisibileControls();
}
- /// <summary>
- /// Update all the UI controls based on the encode task passed in.
- /// </summary>
- /// <param name="task">
- /// The task.
- /// </param>
public void UpdateTask(EncodeTask task)
{
this.Task = task;
+ this.PaddingFilter.UpdateTask(task);
+ this.RotateFlipFilter?.UpdateTask(task);
+
this.NotifyOfPropertyChange(() => this.Width);
this.NotifyOfPropertyChange(() => this.Height);
this.NotifyOfPropertyChange(() => this.SelectedAnamorphicMode);
@@ -752,25 +501,12 @@ namespace HandBrakeWPF.ViewModels this.UpdateVisibileControls();
}
- /// <summary>
- /// Setup this window for a new source
- /// </summary>
- /// <param name="source">
- /// The source.
- /// </param>
- /// <param name="title">
- /// The title.
- /// </param>
- /// <param name="preset">
- /// The preset.
- /// </param>
- /// <param name="task">
- /// The task.
- /// </param>
public void SetSource(Source source, Title title, Preset preset, EncodeTask task)
{
this.currentTitle = title;
this.Task = task;
+ this.PaddingFilter.SetSource(source, title, preset, task);
+ this.RotateFlipFilter?.SetSource(source, title, preset, task);
this.scannedSource = source;
@@ -863,21 +599,26 @@ namespace HandBrakeWPF.ViewModels return false;
}
+ if (!PaddingFilter.MatchesPreset(preset))
+ {
+ return false;
+ }
+
+ if (!RotateFlipFilter.MatchesPreset(preset))
+ {
+ return false;
+ }
+
return true;
}
- #endregion
-
- #region Methods
+ /* Protected and Private Methods */
protected virtual void OnTabStatusChanged(TabStatusEventArgs e)
{
this.TabStatusChanged?.Invoke(this, e);
}
- /// <summary>
- /// The init.
- /// </summary>
private void Init()
{
this.Task.Modulus = 16;
@@ -891,12 +632,6 @@ namespace HandBrakeWPF.ViewModels this.MaxWidth = 1920;
}
- /// <summary>
- /// The get picture title info.
- /// </summary>
- /// <returns>
- /// The <see cref="PictureSize.PictureSettingsTitle"/>.
- /// </returns>
private PictureSize.PictureSettingsTitle GetPictureTitleInfo()
{
PictureSize.PictureSettingsTitle title = new PictureSize.PictureSettingsTitle
@@ -910,12 +645,6 @@ namespace HandBrakeWPF.ViewModels return title;
}
- /// <summary>
- /// The get picture settings.
- /// </summary>
- /// <returns>
- /// The <see cref="PictureSize.PictureSettingsJob"/>.
- /// </returns>
private PictureSize.PictureSettingsJob GetPictureSettings(ChangedPictureField changedField)
{
PictureSize.PictureSettingsJob job = new PictureSize.PictureSettingsJob
@@ -1032,9 +761,6 @@ namespace HandBrakeWPF.ViewModels }
}
- /// <summary>
- /// The update visible controls.
- /// </summary>
private void UpdateVisibileControls()
{
this.ShowDisplaySize = true;
@@ -1080,9 +806,6 @@ namespace HandBrakeWPF.ViewModels /// <summary>
/// For a given value, correct so that it matches the users currently selected modulus value
/// </summary>
- /// <param name="value">
- /// The value.
- /// </param>
/// <returns>
/// Value corrected so that value % selected modulus == 0
/// </returns>
@@ -1107,29 +830,12 @@ namespace HandBrakeWPF.ViewModels return (int)Math.Abs(result);
}
- /// <summary>
- /// The get res.
- /// </summary>
- /// <param name="value">
- /// The value.
- /// </param>
- /// <param name="max">
- /// The max.
- /// </param>
- /// <returns>
- /// The <see cref="int"/>.
- /// </returns>
private int GetRes(int value, int? max)
{
return max.HasValue ? (value > max.Value ? max.Value : value) : value;
}
-
- #endregion
}
- /// <summary>
- /// The changed picture field.
- /// </summary>
public enum ChangedPictureField
{
Width,
diff --git a/win/CS/HandBrakeWPF/Views/AudioView.xaml b/win/CS/HandBrakeWPF/Views/AudioView.xaml index 9b353585c..6b3794dc8 100644 --- a/win/CS/HandBrakeWPF/Views/AudioView.xaml +++ b/win/CS/HandBrakeWPF/Views/AudioView.xaml @@ -43,7 +43,7 @@ <!-- Row 0 -->
<TextBlock Grid.Row="0"
Margin="10,5,0,0"
- FontWeight="Bold"
+ FontSize="12" FontWeight="Bold"
VerticalAlignment="Top"
Text="{Binding PanelTitle}" />
diff --git a/win/CS/HandBrakeWPF/Views/ChaptersView.xaml b/win/CS/HandBrakeWPF/Views/ChaptersView.xaml index e74a896dc..7a14542a0 100644 --- a/win/CS/HandBrakeWPF/Views/ChaptersView.xaml +++ b/win/CS/HandBrakeWPF/Views/ChaptersView.xaml @@ -14,7 +14,7 @@ <RowDefinition Height="*" />
</Grid.RowDefinitions>
- <TextBlock Text="{x:Static Properties:Resources.ChaptersView_ChapterMarkers}" FontWeight="Bold" Margin="10,5,0,0" Grid.Row="0" ></TextBlock>
+ <TextBlock Text="{x:Static Properties:Resources.ChaptersView_ChapterMarkers}" FontSize="12" FontWeight="Bold" Margin="10,5,0,0" Grid.Row="0" ></TextBlock>
<Grid Grid.Row="1" Margin="10,5,10,0">
<Grid.ColumnDefinitions>
diff --git a/win/CS/HandBrakeWPF/Views/FiltersView.xaml b/win/CS/HandBrakeWPF/Views/FiltersView.xaml index 87aa45e50..f49f83f0b 100644 --- a/win/CS/HandBrakeWPF/Views/FiltersView.xaml +++ b/win/CS/HandBrakeWPF/Views/FiltersView.xaml @@ -27,7 +27,7 @@ <ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
- <TextBlock Text="{x:Static Properties:Resources.FiltersView_Filters}" FontWeight="Bold" Margin="10,5,0,0" Grid.Row="0" ></TextBlock>
+ <TextBlock Text="{x:Static Properties:Resources.FiltersView_Filters}" FontSize="12" FontWeight="Bold" Margin="10,5,0,0" Grid.Row="0" />
<StackPanel Orientation="Vertical" Grid.Row="1" Grid.Column="0" Margin="10,10,0,0">
<Grid>
@@ -195,15 +195,6 @@ <CheckBox Content="{x:Static Properties:Resources.FiltersView_Grayscale}" IsChecked="{Binding GrayscaleFilter.Grayscale}" Grid.Row="6" Grid.Column="1" Margin="0,10,0,10"
ToolTip="{x:Static Properties:ResourcesTooltips.FilterView_Grayscale}" />
- <!-- Rotation -->
- <TextBlock Text="{x:Static Properties:Resources.FiltersView_Rotate}" Grid.Row="7" Grid.Column="0" Margin="0,0,0,0"/>
- <ComboBox Width="120" ItemsSource="{Binding RotateFlipFilter.RotationOptions}" Grid.Row="7" Grid.Column="1"
- SelectedItem="{Binding RotateFlipFilter.SelectedRotation}" ToolTip="{x:Static Properties:ResourcesTooltips.FilterView_Rotate}"
- AutomationProperties.Name="{x:Static Properties:Resources.FiltersView_Rotate}"
- HorizontalAlignment="Left" VerticalAlignment="Center" />
-
- <CheckBox Content="{x:Static Properties:Resources.FiltersView_FlipVideo}" Margin="5,0,0,0" VerticalAlignment="Center" Grid.Row="7" Grid.Column="2" IsChecked="{Binding RotateFlipFilter.FlipVideo, UpdateSourceTrigger=PropertyChanged}"
- ToolTip="{x:Static Properties:ResourcesTooltips.FilterView_Flip}"/>
</Grid>
</StackPanel>
diff --git a/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml b/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml index f4ecdf3bb..3c1a71296 100644 --- a/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml +++ b/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml @@ -14,177 +14,290 @@ </Style>
</UserControl.Resources>
- <Border Background="Transparent">
- <Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
+ <Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="*" />
+ <RowDefinition Height="Auto" />
+ </Grid.RowDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="*" />
+ </Grid.ColumnDefinitions>
- <!-- Size Panel-->
- <StackPanel Name="SizePanel" Orientation="Vertical" VerticalAlignment="Top" Margin="5,0,0,0" Grid.Column="0" Grid.Row="0">
- <Label Content="{x:Static Properties:Resources.PictureSettingsView_Size}" FontWeight="Bold" />
- <!-- Row 1-->
- <StackPanel Orientation="Horizontal" Margin="0,0,5,0">
- <Label Content="{x:Static Properties:Resources.PictureSettingsView_Source}" />
- <Label Content="{Binding SourceInfo}" Name="sourceResolution"/>
- </StackPanel>
+ <!-- Size Panel-->
+ <TextBlock Text="{x:Static Properties:Resources.PictureSettingsView_ResAndScaling}" FontSize="12" FontWeight="Bold" Grid.Row="0" Grid.Column="0" Margin="10,5,0,15" />
+ <StackPanel Name="SizePanel" Orientation="Vertical" VerticalAlignment="Top" Margin="5,0,0,0" Grid.Row="1" Grid.Column="0">
+ <!-- Row 1-->
+ <StackPanel Orientation="Horizontal" Margin="0,0,5,0">
+ <Label Content="{x:Static Properties:Resources.PictureSettingsView_Source}" />
+ <Label Content="{Binding SourceInfo}" Name="sourceResolution"/>
+ </StackPanel>
+
+ <!-- Row 2-->
+ <Grid Margin="0,5,5,0">
- <!-- Row 2-->
- <StackPanel Orientation="Horizontal" Margin="0,0,5,0">
- <Label Content="{x:Static Properties:Resources.PictureSettingsView_Width}" />
- <controls:NumberBox Number="{Binding Width, Mode=TwoWay}" UpdateBindingOnTextChange="True" IsEnabled="{Binding WidthControlEnabled}"
- Modulus="{Binding SelectedModulus, Mode=OneWay}"
- ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_Width}" Minimum="0" Width="60"
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ </Grid.RowDefinitions>
+
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
+
+ <Label Content="{x:Static Properties:Resources.PictureSettingsView_Width}" Grid.Row="0" Grid.Column="0" />
+ <controls:NumberBox Number="{Binding Width, Mode=TwoWay}" UpdateBindingOnTextChange="True" IsEnabled="{Binding WidthControlEnabled}" Grid.Row="0" Grid.Column="1"
+ Modulus="{Binding SelectedModulus, Mode=OneWay}" ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_Width}" Minimum="0" Width="60"
AutomationProperties.Name="{x:Static Properties:Resources.PictureSettingsView_Width}" />
- <Label Content="{x:Static Properties:Resources.PictureSettingsView_Height}" />
- <controls:NumberBox Number="{Binding Height, Mode=TwoWay}" IsEnabled="{Binding HeightControlEnabled}" UpdateBindingOnTextChange="True"
+
+ <Label Content="{x:Static Properties:Resources.PictureSettingsView_Height}" Grid.Row="0" Grid.Column="2" />
+ <controls:NumberBox Number="{Binding Height, Mode=TwoWay}" IsEnabled="{Binding HeightControlEnabled}" UpdateBindingOnTextChange="True" Grid.Row="0" Grid.Column="3"
Modulus="{Binding SelectedModulus, Mode=OneWay}"
ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_Height}" Minimum="0" Width="60"
AutomationProperties.Name="{x:Static Properties:Resources.PictureSettingsView_Height}" />
- <CheckBox Content="{x:Static Properties:Resources.PictureSettingsView_KeepAR}" IsChecked="{Binding MaintainAspectRatio}"
+ <CheckBox Content="{x:Static Properties:Resources.PictureSettingsView_KeepAR}" IsChecked="{Binding MaintainAspectRatio}" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="4"
Visibility="{Binding ShowKeepAR, Converter={StaticResource boolToVisHiddenConverter}}" ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_KeepAR}"
- VerticalAlignment="Center" Margin="5,0,0,0" />
- </StackPanel>
+ VerticalAlignment="Center" Margin="0,5,0,0" />
+
+ </Grid>
- <!-- Row 3-->
- <Grid Margin="0,15,5,0">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
+ <!-- Row 3-->
+ <Grid Margin="0,15,5,0">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
- <Label Content="{x:Static Properties:Resources.PictureSettingsView_Anamorphic}" Grid.Row="0" Grid.Column="0" />
- <Label Content="{x:Static Properties:Resources.PictureSettingsView_Modulus}" Grid.Row="1" Grid.Column="0"
+ <Label Content="{x:Static Properties:Resources.PictureSettingsView_Anamorphic}" Grid.Row="0" Grid.Column="0" />
+ <Label Content="{x:Static Properties:Resources.PictureSettingsView_Modulus}" Grid.Row="1" Grid.Column="0"
Visibility="{Binding ShowModulus, Converter={StaticResource boolToVisConverter}}" />
- <ComboBox Width="110" Grid.Row="0" ItemsSource="{Binding AnamorphicModes}" SelectedItem="{Binding SelectedAnamorphicMode}" Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,5"
+ <ComboBox Width="110" Grid.Row="0" ItemsSource="{Binding AnamorphicModes}" SelectedItem="{Binding SelectedAnamorphicMode}" Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,5"
ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_Anamorphic}"
AutomationProperties.Name="{x:Static Properties:Resources.PictureSettingsView_Anamorphic}" />
- <ComboBox Width="110" Grid.Row="1" ItemsSource="{Binding ModulusValues}" SelectedItem="{Binding SelectedModulus}"
+ <ComboBox Width="110" Grid.Row="1" ItemsSource="{Binding ModulusValues}" SelectedItem="{Binding SelectedModulus}"
Visibility="{Binding ShowModulus, Converter={StaticResource boolToVisConverter}}" ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_Modulus}"
Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,5"
AutomationProperties.Name="{x:Static Properties:Resources.PictureSettingsView_Modulus}"/>
- </Grid>
+ </Grid>
- <!-- Custom Anamoprhic -->
- <Grid Margin="0,15,5,0" Visibility="{Binding ShowCustomAnamorphicControls, Converter={StaticResource boolToVisConverter}}">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
+ <!-- Custom Anamoprhic -->
+ <Grid Margin="0,15,5,0" Visibility="{Binding ShowCustomAnamorphicControls, Converter={StaticResource boolToVisConverter}}">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
- <Label Content="{x:Static Properties:Resources.PictureSettingsView_DisplayWitdh}" Grid.Row="0" Grid.Column="0" />
- <Label Content="{x:Static Properties:Resources.PictureSettingsView_PAR}" Grid.Row="1" Grid.Column="0" />
+ <Label Content="{x:Static Properties:Resources.PictureSettingsView_DisplayWitdh}" Grid.Row="0" Grid.Column="0" />
+ <Label Content="{x:Static Properties:Resources.PictureSettingsView_PAR}" Grid.Row="1" Grid.Column="0" />
- <controls:NumberBox Width="60" Number="{Binding DisplayWidth, Mode=TwoWay}" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,5"
+ <controls:NumberBox Width="60" Number="{Binding DisplayWidth, Mode=TwoWay}" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,5"
AllowEmpty="False" IsEnabled="{Binding MaintainAspectRatio, Converter={StaticResource boolConverter}, ConverterParameter=true}"
AutomationProperties.Name="{x:Static Properties:Resources.PictureSettingsView_DisplayWitdh}" />
- <StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="1">
- <controls:NumberBox Width="60" Number="{Binding ParWidth, Mode=TwoWay}" HorizontalAlignment="Left" AllowEmpty="False"
+ <StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="1">
+ <controls:NumberBox Width="60" Number="{Binding ParWidth, Mode=TwoWay}" HorizontalAlignment="Left" AllowEmpty="False"
IsEnabled="{Binding MaintainAspectRatio, Converter={StaticResource boolConverter}, ConverterParameter=true}" Margin="0,0,0,5"
ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_PAR}"/>
- <TextBlock Text="X" Margin="10,0,10,0" />
- <controls:NumberBox Width="60" Number="{Binding ParHeight, Mode=TwoWay}" HorizontalAlignment="Left" AllowEmpty="False"
+ <TextBlock Text="X" Margin="10,0,10,0" />
+ <controls:NumberBox Width="60" Number="{Binding ParHeight, Mode=TwoWay}" HorizontalAlignment="Left" AllowEmpty="False"
IsEnabled="{Binding MaintainAspectRatio, Converter={StaticResource boolConverter}, ConverterParameter=true}" Margin="0,0,0,5"
ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_PAR}"/>
- </StackPanel>
- </Grid>
+ </StackPanel>
+ </Grid>
+
+ </StackPanel>
+
+ <!-- Crop Panel -->
+ <TextBlock Text="{x:Static Properties:Resources.PictureSettingsView_RotateAndCrop}" FontSize="12" FontWeight="Bold" Grid.Row="0" Grid.Column="1" Margin="50,5,0,15" />
+ <Grid Name="CropPanel" Margin="50,0,0,0" VerticalAlignment="Top" HorizontalAlignment="Stretch" Grid.Row="1" Grid.Column="1">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
+
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="*" />
+ </Grid.RowDefinitions>
- </StackPanel>
- <!-- Crop Panel -->
- <StackPanel Name="CropPanel" Margin="15,0,0,0" VerticalAlignment="Top" HorizontalAlignment="Stretch" Grid.Row="0" Grid.RowSpan="2" Grid.Column="1">
- <Label Content="{x:Static Properties:Resources.PictureSettingsView_Cropping}" FontWeight="Bold" />
- <RadioButton Content="{x:Static Properties:Resources.PictureSettingsView_Automatic}" IsChecked="{Binding IsCustomCrop, Converter={StaticResource boolConverter}, ConverterParameter=true}" Margin="10,0,0,0"
- ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_AutoCrop}" />
+ <TextBlock Text="{x:Static Properties:Resources.FiltersView_Rotate}" Margin="0,0,0,0" Grid.Row="0" Grid.Column="0" />
+ <ComboBox Width="120" ItemsSource="{Binding RotateFlipFilter.RotationOptions}" Grid.Row="0" Grid.Column="1"
+ SelectedItem="{Binding RotateFlipFilter.SelectedRotation}" ToolTip="{x:Static Properties:ResourcesTooltips.FilterView_Rotate}"
+ AutomationProperties.Name="{x:Static Properties:Resources.FiltersView_Rotate}" HorizontalAlignment="Left" VerticalAlignment="Center" />
+
+ <CheckBox Content="{x:Static Properties:Resources.FiltersView_FlipVideo}" Margin="5,0,0,0" VerticalAlignment="Center" IsChecked="{Binding RotateFlipFilter.FlipVideo, UpdateSourceTrigger=PropertyChanged}"
+ ToolTip="{x:Static Properties:ResourcesTooltips.FilterView_Flip}" Grid.Row="0" Grid.Column="2" />
+
+
+ <TextBlock Text="{x:Static Properties:Resources.PictureSettingsView_Cropping}" Grid.Row="1" Grid.Column="0" Margin="0,20,0,0" />
+ <StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center" Grid.ColumnSpan="2" Margin="0,20,0,0">
+ <RadioButton Content="{x:Static Properties:Resources.PictureSettingsView_Automatic}" IsChecked="{Binding IsCustomCrop, Converter={StaticResource boolConverter}, ConverterParameter=true}"
+ ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_AutoCrop}" Margin="0,5,0,0" />
<RadioButton Content="{x:Static Properties:Resources.PictureSettingsView_Custom}" IsChecked="{Binding IsCustomCrop}" Margin="10,5,0,0"
ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_ManualCrop}" />
+ </StackPanel>
+
- <Grid Margin="0,10,0,0">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
-
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
-
- <Label Content="{x:Static Properties:Resources.PictureSettingsView_Top}" Grid.Row="0" Grid.Column="2" VerticalAlignment="Center" />
- <Label Content="{x:Static Properties:Resources.PictureSettingsView_Bottom}" Grid.Row="4" Grid.Column="2" VerticalAlignment="Center" />
- <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"
+ <Grid Margin="0,10,0,0" Grid.Row="2" Grid.ColumnSpan="3">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ </Grid.RowDefinitions>
+
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
+
+ <Label Content="{x:Static Properties:Resources.PictureSettingsView_Top}" Grid.Row="0" Grid.Column="2" VerticalAlignment="Center" />
+ <Label Content="{x:Static Properties:Resources.PictureSettingsView_Bottom}" Grid.Row="4" Grid.Column="2" VerticalAlignment="Center" />
+ <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"
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"
+ <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"
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"
+ <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"
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"
+ <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"
ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_CropRight}"
AutomationProperties.Name="{x:Static Properties:Resources.PictureSettingsView_Right}"/>
- </Grid>
+ </Grid>
- </StackPanel>
+ </Grid>
- <!-- Preview Panel -->
- <StackPanel Name="PreviewPanel" Margin="5,5,0,0" VerticalAlignment="Top" HorizontalAlignment="Stretch" Grid.Row="1" Grid.Column="0">
- <Label Content="{x:Static Properties:Resources.PictureSettingsView_Output}" FontWeight="Bold" />
+ <!-- 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" />
+ <Grid Name="PaddingPanel" Margin="20,0,0,0" Grid.Row="1" Grid.Column="2">
- <Grid >
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
+
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="*" />
+ </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
- <Label Content="{Binding DisplaySize}" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left" Margin="0,0,0,5"
+ <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" />
+
+ <Grid Margin="0,10,0,10" Grid.Row="1" Grid.ColumnSpan="2">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ </Grid.RowDefinitions>
+
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
+
+ <Label Content="{x:Static Properties:Resources.PictureSettingsView_Top}" Grid.Row="0" Grid.Column="2" VerticalAlignment="Center" />
+ <Label Content="{x:Static Properties:Resources.PictureSettingsView_Bottom}" Grid.Row="4" Grid.Column="2" VerticalAlignment="Center" />
+ <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"
+ 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"
+ 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"
+ 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"
+ 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" />
+
+ </Grid>-->
+
+ <!-- Output Panel -->
+ <StackPanel Name="PreviewPanel" Margin="5,5,0,0" VerticalAlignment="Top" HorizontalAlignment="Stretch" Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="4">
+ <Label Content="{x:Static Properties:Resources.PictureSettingsView_Output}" FontSize="12" FontWeight="Bold" />
+
+ <Grid >
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ </Grid.RowDefinitions>
+
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
+
+ <Label Content="{Binding DisplaySize}" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left" Margin="0,0,0,5"
Visibility="{Binding ShowDisplaySize, Converter={StaticResource boolToVisConverter}}" />
- </Grid>
-
- </StackPanel>
- </Grid>
- </Border>
+ </Grid>
+
+ </StackPanel>
+ </Grid>
+
</UserControl>
diff --git a/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml b/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml index 8510ad654..51600df14 100644 --- a/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml +++ b/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml @@ -46,7 +46,7 @@ <!-- Row 0 -->
<TextBlock Grid.Row="0" Grid.Column="0"
Margin="10,5,0,0"
- FontWeight="Bold"
+ FontSize="12" FontWeight="Bold"
VerticalAlignment="Top"
Text="{Binding PanelTitle}" />
diff --git a/win/CS/HandBrakeWPF/Views/SummaryView.xaml b/win/CS/HandBrakeWPF/Views/SummaryView.xaml index 9ec428b0e..e6d5746b4 100644 --- a/win/CS/HandBrakeWPF/Views/SummaryView.xaml +++ b/win/CS/HandBrakeWPF/Views/SummaryView.xaml @@ -55,7 +55,7 @@ </Grid.Resources> - <TextBlock Text="{x:Static Properties:Resources.MainView_Format}" FontWeight="Bold" Grid.Row="0" VerticalAlignment="Center" /> + <TextBlock Text="{x:Static Properties:Resources.MainView_Format}" FontSize="12" FontWeight="Bold" Grid.Row="0" VerticalAlignment="Center" /> <ComboBox Name="Container" Width="100" HorizontalAlignment="Left" Grid.Row="0" Grid.Column="1" ToolTip="{x:Static Properties:ResourcesTooltips.MainView_Mux}" VerticalAlignment="Center" ItemsSource="{Binding OutputFormats, Converter={StaticResource enumComboConverter}}" @@ -77,18 +77,18 @@ IsChecked="{Binding Path=IPod5GSupport}" Visibility="{Binding IsIpodAtomVisible, Converter={StaticResource boolToVisConverter}}" /> - <TextBlock Text="{x:Static Properties:Resources.MainView_Tracks}" FontWeight="Bold" Grid.Row="5" Grid.Column="0" VerticalAlignment="Center" /> + <TextBlock Text="{x:Static Properties:Resources.MainView_Tracks}" FontSize="12" FontWeight="Bold" Grid.Row="5" Grid.Column="0" VerticalAlignment="Center" /> <TextBlock Text="{Binding VideoTrackInfo}" Grid.Row="5" Grid.Column="1" VerticalAlignment="Center" /> <TextBlock Text="{Binding AudioTrackInfo}" Grid.Row="6" Grid.Column="1" TextWrapping="Wrap" /> <TextBlock Text="{Binding SubtitleTrackInfo}" Grid.Row="7" Grid.Column="1" TextWrapping="Wrap" /> <TextBlock Text="{Binding ChapterInfo}" Grid.Row="8" Grid.Column="1" /> - <TextBlock Text="{x:Static Properties:Resources.MainView_Filters}" FontWeight="Bold" Grid.Row="10" Grid.Column="0" VerticalAlignment="Center" /> + <TextBlock Text="{x:Static Properties:Resources.MainView_Filters}" FontSize="12" FontWeight="Bold" Grid.Row="10" Grid.Column="0" VerticalAlignment="Center" /> <TextBlock Text="{Binding FiltersInfo}" Grid.Row="10" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Stretch" TextWrapping="Wrap" /> - <TextBlock Text="{x:Static Properties:Resources.MainView_Size}" FontWeight="Bold" Grid.Row="12" Grid.Column="0" VerticalAlignment="Center" /> + <TextBlock Text="{x:Static Properties:Resources.MainView_Size}" FontSize="12" FontWeight="Bold" Grid.Row="12" Grid.Column="0" VerticalAlignment="Center" /> <TextBlock Text="{Binding DimensionInfo}" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Row="12" Grid.Column="1" /> <TextBlock Text="{x:Static Properties:Resources.MainView_Aspect}" FontSize="14" Grid.Row="13" Grid.Column="0" VerticalAlignment="Center" Visibility="Collapsed" /> diff --git a/win/CS/HandBrakeWPF/Views/VideoView.xaml b/win/CS/HandBrakeWPF/Views/VideoView.xaml index afe60ddfe..739c50a89 100644 --- a/win/CS/HandBrakeWPF/Views/VideoView.xaml +++ b/win/CS/HandBrakeWPF/Views/VideoView.xaml @@ -37,7 +37,7 @@ <StackPanel Orientation="Vertical" Grid.Column="0" >
- <TextBlock Text="{x:Static Properties:Resources.VideoView_Video}" FontWeight="Bold" Margin="0,0,0,10"/>
+ <TextBlock Text="{x:Static Properties:Resources.VideoView_Video}" FontSize="12" FontWeight="Bold" Margin="0,0,0,10"/>
<StackPanel Orientation="Horizontal" Margin="0,0,0,10" >
<TextBlock Text="{x:Static Properties:Resources.VideoView_Codec}" Width="100" />
@@ -78,7 +78,7 @@ </StackPanel>
<StackPanel Orientation="Vertical" Grid.Column="1">
- <TextBlock Text="{x:Static Properties:Resources.VideoView_Quality}" FontWeight="Bold" Margin="0,0,0,10"/>
+ <TextBlock Text="{x:Static Properties:Resources.VideoView_Quality}" FontSize="12" FontWeight="Bold" Margin="0,0,0,10"/>
<StackPanel Orientation="Horizontal" Margin="0,0,0,10" >
<RadioButton Content="{x:Static Properties:Resources.VideoView_ConstantQuality}" IsChecked="{Binding IsConstantQuantity}" Margin="0,0,10,0"
@@ -128,7 +128,7 @@ <RowDefinition Height="*" />
</Grid.RowDefinitions>
- <TextBlock Text="{x:Static Properties:Resources.VideoView_OptimiseVideo}" Margin="0,0,0,0" Grid.Row="0" Grid.ColumnSpan="2" FontWeight="Bold" VerticalAlignment="Center" />
+ <TextBlock Text="{x:Static Properties:Resources.VideoView_OptimiseVideo}" Margin="0,0,0,0" Grid.Row="0" Grid.ColumnSpan="2" FontSize="12" FontWeight="Bold" VerticalAlignment="Center" />
<Grid Grid.Row="1" Margin="0,8,0,0">
<Grid.RowDefinitions>
|