mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-27 00:07:58 +01:00
Merge pull request #1000 from BDisp/toplevel-redraw
Fixes #999. Toplevel should only redraw the subviews if !NeedDisplay.IsEmpty or layoutNeeded.
This commit is contained in:
@@ -399,7 +399,7 @@ namespace Terminal.Gui {
|
||||
Application.CurrentView = this;
|
||||
|
||||
if (IsCurrentTop || this == Application.Top) {
|
||||
if (!NeedDisplay.IsEmpty) {
|
||||
if (!NeedDisplay.IsEmpty || layoutNeeded) {
|
||||
Driver.SetAttribute (Colors.TopLevel.Normal);
|
||||
|
||||
// This is the Application.Top. Clear just the region we're being asked to redraw
|
||||
@@ -407,15 +407,17 @@ namespace Terminal.Gui {
|
||||
Clear (bounds);
|
||||
Driver.SetAttribute (Colors.Base.Normal);
|
||||
PositionToplevels ();
|
||||
}
|
||||
foreach (var view in Subviews) {
|
||||
if (view.Frame.IntersectsWith (bounds)) {
|
||||
view.SetNeedsLayout ();
|
||||
view.SetNeedsDisplay (view.Bounds);
|
||||
}
|
||||
}
|
||||
|
||||
ClearNeedsDisplay ();
|
||||
foreach (var view in Subviews) {
|
||||
if (view.Frame.IntersectsWith (bounds)) {
|
||||
view.SetNeedsLayout ();
|
||||
view.SetNeedsDisplay (view.Bounds);
|
||||
}
|
||||
}
|
||||
|
||||
layoutNeeded = false;
|
||||
ClearNeedsDisplay ();
|
||||
}
|
||||
}
|
||||
|
||||
base.Redraw (base.Bounds);
|
||||
|
||||
Reference in New Issue
Block a user