ソースを参照

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 年 前
コミット
f57b647ab0
1 ファイル変更8 行追加2 行削除
  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;
 		}