Skip to content

Commit

Permalink
Fix: Removing Border from parent alters border brush
Browse files Browse the repository at this point in the history
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'
  • Loading branch information
PentagramPro authored and tig committed Jul 25, 2023
1 parent d6a237f commit f57b647
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Terminal.Gui/Core/Border.cs
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,14 @@ public View Child {

private void Parent_Removed (View obj)
{
BorderBrush = default;
Background = default;
if (borderBrush != null)
{
BorderBrush = default;
}
if (background != null)
{
Background = default;
}
child.Removed -= Parent_Removed;
}

Expand Down

0 comments on commit f57b647

Please sign in to comment.