mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-27 16:27:55 +01:00
Make SpinnerView show/hide instead of stopping
This commit is contained in:
@@ -79,7 +79,7 @@ namespace UICatalog.Scenarios {
|
||||
ActivityProgressBar = new ProgressBar () {
|
||||
X = Pos.Right (LeftFrame) + 1,
|
||||
Y = Pos.Bottom (startButton) + 1,
|
||||
Width = Dim.Fill (1),
|
||||
Width = Dim.Fill (),
|
||||
Height = 1,
|
||||
Fraction = 0.25F,
|
||||
ColorScheme = Colors.Error
|
||||
@@ -88,7 +88,9 @@ namespace UICatalog.Scenarios {
|
||||
|
||||
Spinner = new SpinnerView {
|
||||
X = Pos.Right (ActivityProgressBar),
|
||||
Y = ActivityProgressBar.Y
|
||||
Y = ActivityProgressBar.Y,
|
||||
Visible = false,
|
||||
|
||||
};
|
||||
Add (Spinner);
|
||||
|
||||
@@ -117,12 +119,23 @@ namespace UICatalog.Scenarios {
|
||||
{
|
||||
Started = true;
|
||||
StartBtnClick?.Invoke ();
|
||||
Application.MainLoop.Invoke(()=>{
|
||||
Spinner.Visible = true;
|
||||
ActivityProgressBar.Width = Dim.Fill(1);
|
||||
this.LayoutSubviews();
|
||||
});
|
||||
}
|
||||
|
||||
internal void Stop ()
|
||||
{
|
||||
Started = false;
|
||||
StopBtnClick?.Invoke ();
|
||||
|
||||
Application.MainLoop.Invoke(()=>{
|
||||
Spinner.Visible = false;
|
||||
ActivityProgressBar.Width = Dim.Fill();
|
||||
this.LayoutSubviews();
|
||||
});
|
||||
}
|
||||
|
||||
internal void Pulse ()
|
||||
|
||||
Reference in New Issue
Block a user