mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-01 16:59:35 +01:00
Added Applicaton.ClearScreenNextIteration
This commit is contained in:
@@ -505,6 +505,11 @@ public static partial class Application // Run (Begin, Run, End, Stop)
|
||||
{
|
||||
bool neededLayout = View.Layout (TopLevels.Reverse (), Screen.Size);
|
||||
|
||||
if (ClearScreenNextIteration)
|
||||
{
|
||||
forceDraw = true;
|
||||
ClearScreenNextIteration = false;
|
||||
}
|
||||
if (forceDraw)
|
||||
{
|
||||
Driver?.ClearContents ();
|
||||
|
||||
@@ -67,4 +67,13 @@ public static partial class Application // Screen related stuff
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether the screen will be cleared, and all Views redrawn, during the next Application iteration.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This is typicall set to true when a View's <see cref="View.Frame"/> changes and that view has no
|
||||
/// SuperView (e.g. when <see cref="Application.Top"/> is moved or resized.
|
||||
/// </remarks>
|
||||
public static bool ClearScreenNextIteratio { get; set; }
|
||||
}
|
||||
|
||||
@@ -215,6 +215,8 @@ public static partial class Application
|
||||
|
||||
Navigation = null;
|
||||
|
||||
ClearScreenNextIteration = false;
|
||||
|
||||
AddApplicationKeyBindings ();
|
||||
|
||||
// Reset synchronization context to allow the user to run async/await,
|
||||
|
||||
@@ -557,7 +557,14 @@ public partial class View // Layout APIs
|
||||
SetTitleTextFormatterSize ();
|
||||
}
|
||||
|
||||
SuperView?.SetNeedsDraw ();
|
||||
if (SuperView is { })
|
||||
{
|
||||
SuperView?.SetNeedsDraw ();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Application.ClearScreenNextIteration = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (TextFormatter.ConstrainToWidth is null)
|
||||
|
||||
Reference in New Issue
Block a user