Selaa lähdekoodia

updated progress demo

Charlie Kindel 5 vuotta sitten
vanhempi
commit
e774b7265f
2 muutettua tiedostoa jossa 3 lisäystä ja 3 poistoa
  1. 1 1
      Terminal.Gui/Core.cs
  2. 2 2
      UICatalog/Scenarios/Progress.cs

+ 1 - 1
Terminal.Gui/Core.cs

@@ -1650,7 +1650,7 @@ namespace Terminal.Gui {
 			int l = m ? 1 : 0;
 			ny = Math.Max (y, l);
 			if (SuperView == null || SuperView.GetType() != typeof(Toplevel))
-				s = Application.Top.HasStatusBar;
+				s = Application.Top.StatusBar != null;
 			else
 				s = ((Toplevel)SuperView).StatusBar != null;
 			l = s ? Driver.Rows - 1 : Driver.Rows;

+ 2 - 2
UICatalog/Scenarios/Progress.cs

@@ -81,12 +81,12 @@ namespace UICatalog {
 			_activityProgressBar.Fraction = 0F;
 			_pulseProgressBar.Fraction = 0F;
 
-			_timer = new Timer ((o) => Application.MainLoop.Invoke (() => Pulse ()), null, 0, 10);
+			_timer = new Timer ((o) => Application.MainLoop.Invoke (() => Pulse ()), null, 0, 250);
 
 			// BUGBUG: This timeout does nothing but return true, however it trigger the Application.MainLoop
 			// to run the Action. Without this timeout, the display updates are random, 
 			// or triggered by user interaction with the UI. See #155
-			_timeoutToken = Application.MainLoop.AddTimeout (TimeSpan.FromMilliseconds (10), loop => true);
+			//_timeoutToken = Application.MainLoop.AddTimeout (TimeSpan.FromMilliseconds (10), loop => true);
 		}
 
 		private void Stop ()