Răsfoiți Sursa

Fix: Removing Border from parent alters border brush

When border is removed from parent, BorderBrush and Background are set to default. However, if they were null in first place, that alters Border behaviour if you re-add the view back later. Altering happens because null is treated as 'Take border color from parent scheme' and default is treated as 'Use black'
Maxim 2 ani în urmă
părinte
comite
f57b647ab0
1 a modificat fișierele cu 8 adăugiri și 2 ștergeri
  1. 8 2
      Terminal.Gui/Core/Border.cs

+ 8 - 2
Terminal.Gui/Core/Border.cs

@@ -445,8 +445,14 @@ namespace Terminal.Gui {
 
 		private void Parent_Removed (View obj)
 		{
-			BorderBrush = default;
-			Background = default;
+			if (borderBrush != null)
+			{
+				BorderBrush = default;
+			}
+			if (background != null)
+			{
+				Background = default;
+			}
 			child.Removed -= Parent_Removed;
 		}