diff --git a/MatterControlLib/ControlElements/MHPasswordTextEditWidget.cs b/MatterControlLib/ControlElements/MHPasswordTextEditWidget.cs index 2cbef5483..638347c3a 100644 --- a/MatterControlLib/ControlElements/MHPasswordTextEditWidget.cs +++ b/MatterControlLib/ControlElements/MHPasswordTextEditWidget.cs @@ -28,6 +28,7 @@ either expressed or implied, of the FreeBSD Project. */ using System; +using MatterHackers.Agg; using MatterHackers.Agg.UI; using MatterHackers.VectorMath; @@ -37,17 +38,34 @@ namespace MatterHackers.MatterControl { private TextEditWidget passwordCoverText; + private class TextEditOverlay : TextEditWidget + { + public TextEditOverlay(string text, int pointSize, double pixelWidth, double pixelHeight, bool multiLine) + : base(text, 0, 0, pointSize, pixelWidth, pixelHeight, multiLine) + { + } + + public override Color BackgroundColor + { + get => this.Parent.BackgroundColor; + set + { + this.Parent.BackgroundColor = value; + } + } + } + public MHPasswordTextEditWidget(string text, ThemeConfig theme, double pixelWidth = 0, double pixelHeight = 0, bool multiLine = false, int tabIndex = 0, string messageWhenEmptyAndNotSelected = "") : base(text, theme, pixelWidth, pixelHeight, multiLine, tabIndex, messageWhenEmptyAndNotSelected) { // remove this so that we can have other content first (the hidden letters) this.RemoveChild(noContentFieldDescription); - passwordCoverText = new TextEditWidget(text, 0, 0, theme.DefaultFontSize, pixelWidth, pixelHeight, multiLine) + passwordCoverText = new TextEditOverlay(text, theme.DefaultFontSize, pixelWidth, pixelHeight, multiLine) { Selectable = false, HAnchor = HAnchor.Stretch, - VAnchor = VAnchor.Bottom + VAnchor = VAnchor.Bottom, }; passwordCoverText.MinimumSize = new Vector2(Math.Max(passwordCoverText.MinimumSize.X, pixelWidth), Math.Max(passwordCoverText.MinimumSize.Y, pixelHeight)); this.AddChild(passwordCoverText); diff --git a/MatterControlLib/ControlElements/MHTextEditWidget.cs b/MatterControlLib/ControlElements/MHTextEditWidget.cs index 4dcf2f655..d2cdccbab 100644 --- a/MatterControlLib/ControlElements/MHTextEditWidget.cs +++ b/MatterControlLib/ControlElements/MHTextEditWidget.cs @@ -53,6 +53,7 @@ namespace MatterHackers.MatterControl this.ActualTextEditWidget = new TextEditWidget(text, 0, 0, theme.DefaultFontSize, pixelWidth, pixelHeight, multiLine, tabIndex: tabIndex, typeFace: typeFace) { VAnchor = VAnchor.Bottom, + BackgroundColor = Color.Transparent }; var internalWidget = this.ActualTextEditWidget.InternalTextEditWidget; diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 7c4f863bd..26b017d62 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 7c4f863bdf87d1a0fdfc82bfade3c969134fb237 +Subproject commit 26b017d62a1fcd3f54d2d1336be4df7449ac9046