Add many styles to SpinnerView (#2510)

* Add many styles to SpinnerView

* Add SpinnerStyles as a nested class

* Allow zero as valid spinner delay value

* Change from BorderStyle to LineStyle

* Rename SpinDelayInMilliseconds to just SpinDelay

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
This commit is contained in:
Nutzzz
2023-04-17 08:36:53 -07:00
committed by GitHub
parent 962ccc6c0a
commit f280ded145
7 changed files with 2123 additions and 93 deletions

View File

@@ -42,19 +42,19 @@ namespace Terminal.Gui.ViewsTests {
view.Redraw (view.Bounds);
var expected = "/";
var expected = @"\";
TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
view.SetNeedsDisplay ();
view.Redraw (view.Bounds);
expected = "/";
expected = @"\";
TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
view.SetNeedsDisplay ();
view.Redraw (view.Bounds);
expected = "/";
expected = @"\";
TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
Task.Delay (400).Wait();
@@ -62,24 +62,24 @@ namespace Terminal.Gui.ViewsTests {
view.SetNeedsDisplay ();
view.Redraw (view.Bounds);
expected = "";
expected = "|";
TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
}
[Fact, AutoInitShutdown]
public void TestSpinnerView_NoThrottle ()
{
var view = GetSpinnerView ();
view.SpinDelayInMilliseconds = 0;
view.SpinDelay = 0;
view.Redraw (view.Bounds);
var expected = @"─";
var expected = "|";
TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
view.SetNeedsDisplay ();
view.Redraw (view.Bounds);
expected = @"\";
expected = "/";
TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
}