From edc0f8b517623ed1f64aa51da4a52c325b447ece Mon Sep 17 00:00:00 2001 From: OmrSi Date: Tue, 28 Mar 2023 02:24:10 +0200 Subject: [PATCH] Add mpv outline color hidden option --- src/libse/Common/Settings.cs | 9 +++++++++ src/ui/Controls/VideoPlayerContainer.cs | 1 + 2 files changed, 10 insertions(+) diff --git a/src/libse/Common/Settings.cs b/src/libse/Common/Settings.cs index 06404abee..2ec0c7049 100644 --- a/src/libse/Common/Settings.cs +++ b/src/libse/Common/Settings.cs @@ -1399,6 +1399,7 @@ $HorzAlign = Center public bool MpvLogging { get; set; } public bool MpvHandlesPreviewText { get; set; } public Color MpvPreviewTextPrimaryColor { get; set; } + public Color MpvPreviewTextOutlineColor { get; set; } public decimal MpvPreviewTextOutlineWidth { get; set; } public decimal MpvPreviewTextShadowWidth { get; set; } public bool MpvPreviewTextOpaqueBox { get; set; } @@ -1580,6 +1581,7 @@ $HorzAlign = Center MpvVideoOutputLinux = "x11"; // could also be e.g. "x11"; MpvHandlesPreviewText = true; MpvPreviewTextPrimaryColor = Color.White; + MpvPreviewTextOutlineColor = Color.Black; MpvPreviewTextOutlineWidth = 1; MpvPreviewTextShadowWidth = 1; MpvPreviewTextOpaqueBox = false; @@ -4128,6 +4130,12 @@ $HorzAlign = Center settings.General.MpvPreviewTextPrimaryColor = ColorTranslator.FromHtml(subNode.InnerText.Trim()); } + subNode = node.SelectSingleNode("MpvPreviewTextOutlineColor"); + if (subNode != null) + { + settings.General.MpvPreviewTextOutlineColor = ColorTranslator.FromHtml(subNode.InnerText.Trim()); + } + subNode = node.SelectSingleNode("MpvPreviewTextOutlineWidth"); if (subNode != null) { @@ -10308,6 +10316,7 @@ $HorzAlign = Center textWriter.WriteElementString("MpvLogging", settings.General.MpvLogging.ToString(CultureInfo.InvariantCulture)); textWriter.WriteElementString("MpvHandlesPreviewText", settings.General.MpvHandlesPreviewText.ToString(CultureInfo.InvariantCulture)); textWriter.WriteElementString("MpvPreviewTextPrimaryColor", ColorTranslator.ToHtml(settings.General.MpvPreviewTextPrimaryColor)); + textWriter.WriteElementString("MpvPreviewTextOutlineColor", ToHtml(settings.General.MpvPreviewTextOutlineColor)); textWriter.WriteElementString("MpvPreviewTextOutlineWidth", settings.General.MpvPreviewTextOutlineWidth.ToString(CultureInfo.InvariantCulture)); textWriter.WriteElementString("MpvPreviewTextShadowWidth", settings.General.MpvPreviewTextShadowWidth.ToString(CultureInfo.InvariantCulture)); textWriter.WriteElementString("MpvPreviewTextOpaqueBox", settings.General.MpvPreviewTextOpaqueBox.ToString(CultureInfo.InvariantCulture)); diff --git a/src/ui/Controls/VideoPlayerContainer.cs b/src/ui/Controls/VideoPlayerContainer.cs index abd179f5e..d9ed35609 100644 --- a/src/ui/Controls/VideoPlayerContainer.cs +++ b/src/ui/Controls/VideoPlayerContainer.cs @@ -411,6 +411,7 @@ namespace Nikse.SubtitleEdit.Controls FontSize = gs.VideoPlayerPreviewFontSize, Bold = gs.VideoPlayerPreviewFontBold, Primary = gs.MpvPreviewTextPrimaryColor, + Outline = gs.MpvPreviewTextOutlineColor, OutlineWidth = gs.MpvPreviewTextOutlineWidth, ShadowWidth = gs.MpvPreviewTextShadowWidth, BorderStyle = gs.MpvPreviewTextOpaqueBox ? "3" : "1",