Merge pull request #1019 from BDisp/childneedsdisplay

Fixes #1018. Since childNeedsDisplay is used outside the View class it must to be a property.
This commit is contained in:
Charlie Kindel
2020-11-19 16:55:52 -07:00
committed by GitHub
3 changed files with 11 additions and 11 deletions

View File

@@ -588,11 +588,11 @@ namespace Terminal.Gui {
} else if (!wait) {
return;
}
if (state.Toplevel != Top && (!Top.NeedDisplay.IsEmpty || Top.childNeedsDisplay)) {
if (state.Toplevel != Top && (!Top.NeedDisplay.IsEmpty || Top.ChildNeedsDisplay)) {
Top.Redraw (Top.Bounds);
state.Toplevel.SetNeedsDisplay (state.Toplevel.Bounds);
}
if (!state.Toplevel.NeedDisplay.IsEmpty || state.Toplevel.childNeedsDisplay) {
if (!state.Toplevel.NeedDisplay.IsEmpty || state.Toplevel.ChildNeedsDisplay) {
state.Toplevel.Redraw (state.Toplevel.Bounds);
if (DebugDrawBounds) {
DrawBounds (state.Toplevel);

View File

@@ -721,7 +721,7 @@ namespace Terminal.Gui {
NeedDisplay = new Rect (x, y, w, h);
}
if (container != null)
container.ChildNeedsDisplay ();
container.SetChildNeedsDisplay ();
if (subviews == null)
return;
foreach (var view in subviews)
@@ -733,16 +733,16 @@ namespace Terminal.Gui {
}
}
internal bool childNeedsDisplay;
internal bool ChildNeedsDisplay { get; private set; }
/// <summary>
/// Indicates that any child views (in the <see cref="Subviews"/> list) need to be repainted.
/// </summary>
public void ChildNeedsDisplay ()
public void SetChildNeedsDisplay ()
{
childNeedsDisplay = true;
ChildNeedsDisplay = true;
if (container != null)
container.ChildNeedsDisplay ();
container.SetChildNeedsDisplay ();
}
internal bool addingView = false;
@@ -1288,7 +1288,7 @@ namespace Terminal.Gui {
protected void ClearNeedsDisplay ()
{
NeedDisplay = Rect.Empty;
childNeedsDisplay = false;
ChildNeedsDisplay = false;
}
/// <summary>
@@ -1333,7 +1333,7 @@ namespace Terminal.Gui {
if (subviews != null) {
foreach (var view in subviews) {
if (!view.NeedDisplay.IsEmpty || view.childNeedsDisplay) {
if (!view.NeedDisplay.IsEmpty || view.ChildNeedsDisplay) {
if (view.Frame.IntersectsWith (clipRect) && (view.Frame.IntersectsWith (bounds) || bounds.X < 0 || bounds.Y < 0)) {
if (view.LayoutNeeded)
view.LayoutSubviews ();
@@ -1346,7 +1346,7 @@ namespace Terminal.Gui {
}
}
view.NeedDisplay = Rect.Empty;
view.childNeedsDisplay = false;
view.ChildNeedsDisplay = false;
}
}
}

View File

@@ -253,7 +253,7 @@ namespace UICatalog {
_leftPane.Height = Dim.Fill(_statusBar.Visible ? 1 : 0);
_rightPane.Height = Dim.Fill(_statusBar.Visible ? 1 : 0);
_top.LayoutSubviews();
_top.ChildNeedsDisplay();
_top.SetChildNeedsDisplay();
}),
};