浏览代码

Fixes #1052. Application.CurrentView looks unused.

BDisp 4 年之前
父节点
当前提交
2d6e7cda99

+ 1 - 13
Terminal.Gui/Core/Application.cs

@@ -72,12 +72,6 @@ namespace Terminal.Gui {
 		/// <value>The current.</value>
 		public static Toplevel Current { get; private set; }
 
-		/// <summary>
-		/// The current <see cref="View"/> object being redrawn.
-		/// </summary>
-		/// /// <value>The current.</value>
-		public static View CurrentView { get; set; }
-
 		/// <summary>
 		/// The current <see cref="ConsoleDriver.HeightAsBuffer"/> used in the terminal.
 		/// </summary>
@@ -193,7 +187,7 @@ namespace Terminal.Gui {
 		/// Loads the right <see cref="ConsoleDriver"/> for the platform.
 		/// </para>
 		/// <para>
-		/// Creates a <see cref="Toplevel"/> and assigns it to <see cref="Top"/> and <see cref="CurrentView"/>
+		/// Creates a <see cref="Toplevel"/> and assigns it to <see cref="Top"/>
 		/// </para>
 		/// </remarks>
 		public static void Init (ConsoleDriver driver = null, IMainLoopDriver mainLoopDriver = null) => Init (() => Toplevel.Create (), driver, mainLoopDriver);
@@ -244,7 +238,6 @@ namespace Terminal.Gui {
 			}
 			Top = topLevelFactory ();
 			Current = Top;
-			CurrentView = Top;
 			_initialized = true;
 		}
 
@@ -541,7 +534,6 @@ namespace Terminal.Gui {
 			}
 			toplevels.Clear ();
 			Current = null;
-			CurrentView = null;
 			Top = null;
 
 			MainLoop = null;
@@ -552,8 +544,6 @@ namespace Terminal.Gui {
 
 		static void Redraw (View view)
 		{
-			Application.CurrentView = view;
-
 			view.Redraw (view.Bounds);
 			Driver.Refresh ();
 		}
@@ -588,10 +578,8 @@ namespace Terminal.Gui {
 
 			if (toplevels.Count == 0) {
 				Current = null;
-				CurrentView = null;
 			} else {
 				Current = toplevels.Peek ();
-				CurrentView = Current;
 				Refresh ();
 			}
 		}

+ 0 - 2
Terminal.Gui/Core/Toplevel.cs

@@ -428,8 +428,6 @@ namespace Terminal.Gui {
 		///<inheritdoc/>
 		public override void Redraw (Rect bounds)
 		{
-			Application.CurrentView = this;
-
 			if (IsCurrentTop || this == Application.Top) {
 				if (!NeedDisplay.IsEmpty || LayoutNeeded) {
 					Driver.SetAttribute (Colors.TopLevel.Normal);

+ 0 - 3
Terminal.Gui/Core/View.cs

@@ -1314,8 +1314,6 @@ namespace Terminal.Gui {
 				return;
 			}
 
-			Application.CurrentView = this;
-
 			var clipRect = new Rect (Point.Empty, frame.Size);
 
 			if (ColorScheme != null) {
@@ -1340,7 +1338,6 @@ namespace Terminal.Gui {
 						if (view.Frame.IntersectsWith (clipRect) && (view.Frame.IntersectsWith (bounds) || bounds.X < 0 || bounds.Y < 0)) {
 							if (view.LayoutNeeded)
 								view.LayoutSubviews ();
-							Application.CurrentView = view;
 
 							// Draw the subview
 							// Use the view's bounds (view-relative; Location will always be (0,0)

+ 0 - 1
Terminal.Gui/Core/Window.cs

@@ -169,7 +169,6 @@ namespace Terminal.Gui {
 		public override void Redraw (Rect bounds)
 		{
 			//var padding = 0;
-			Application.CurrentView = this;
 			var scrRect = ViewToScreen (new Rect (0, 0, Frame.Width, Frame.Height));
 
 			// BUGBUG: Why do we draw the frame twice? This call is here to clear the content area, I think. Why not just clear that area?

+ 0 - 1
Terminal.Gui/Views/FrameView.cs

@@ -147,7 +147,6 @@ namespace Terminal.Gui {
 		public override void Redraw (Rect bounds)
 		{
 			var padding = 0;
-			Application.CurrentView = this;
 			var scrRect = ViewToScreen (new Rect (0, 0, Frame.Width, Frame.Height));
 
 			if (!NeedDisplay.IsEmpty) {