-
Notifications
You must be signed in to change notification settings - Fork 700
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3858 from tig/v2_3857-App-Top-Redraw
Fixes #3857 - Screen now clears when `Application.Top` is sized/moved
- Loading branch information
Showing
14 changed files
with
111 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
using Xunit.Abstractions; | ||
|
||
namespace Terminal.Gui.ApplicationTests; | ||
|
||
public class ApplicationScreenTests (ITestOutputHelper output) | ||
{ | ||
[Fact] | ||
public void ClearScreenNextIteration_Resets_To_False_After_LayoutAndDraw () | ||
{ | ||
// Arrange | ||
Application.Init (); | ||
|
||
// Act | ||
Application.ClearScreenNextIteration = true; | ||
Application.LayoutAndDraw (); | ||
|
||
// Assert | ||
Assert.False (Application.ClearScreenNextIteration); | ||
|
||
// Cleanup | ||
Application.ResetState (true); | ||
} | ||
|
||
[Fact] | ||
public void ClearContents_Called_When_Top_Frame_Changes () | ||
{ | ||
// Arrange | ||
Application.Init (new FakeDriver ()); | ||
Application.Top = new Toplevel (); | ||
Application.TopLevels.Push (Application.Top); | ||
|
||
int clearedContentsRaised = 0; | ||
|
||
Application.Driver!.ClearedContents += (e, a) => clearedContentsRaised++; | ||
|
||
// Act | ||
Application.LayoutAndDraw (); | ||
|
||
// Assert | ||
Assert.Equal (1, clearedContentsRaised); | ||
|
||
// Act | ||
Application.Top.SetNeedsLayout (); | ||
Application.LayoutAndDraw (); | ||
|
||
// Assert | ||
Assert.Equal (1, clearedContentsRaised); | ||
|
||
// Act | ||
Application.Top.X = 1; | ||
Application.LayoutAndDraw (); | ||
|
||
// Assert | ||
Assert.Equal (2, clearedContentsRaised); | ||
|
||
// Act | ||
Application.Top.Width = 10; | ||
Application.LayoutAndDraw (); | ||
|
||
// Assert | ||
Assert.Equal (3, clearedContentsRaised); | ||
|
||
// Cleanup | ||
Application.Top.Dispose (); | ||
Application.Top = null; | ||
Application.Shutdown (); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
namespace Terminal.Gui; | ||
| ||
namespace Terminal.Gui.BuildAndDeployTests; | ||
|
||
public class LocalPackagesTests | ||
{ | ||
|
This file was deleted.
Oops, something went wrong.