浏览代码

Fixes #503 Tab stop working.

BDisp 5 年之前
父节点
当前提交
068b19d0b4
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      Terminal.Gui/Core/Toplevel.cs

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

@@ -5,7 +5,9 @@
 //   Miguel de Icaza ([email protected])
 //   Miguel de Icaza ([email protected])
 //
 //
 using System;
 using System;
+using System.Collections.Generic;
 using System.ComponentModel;
 using System.ComponentModel;
+using System.Linq;
 
 
 namespace Terminal.Gui {
 namespace Terminal.Gui {
 	/// <summary>
 	/// <summary>
@@ -150,6 +152,8 @@ namespace Terminal.Gui {
 				if (old != Focused) {
 				if (old != Focused) {
 					old?.SetNeedsDisplay ();
 					old?.SetNeedsDisplay ();
 					Focused?.SetNeedsDisplay ();
 					Focused?.SetNeedsDisplay ();
+				} else {
+					FocusNearestView (GetSuperViewSubviews (true), true);
 				}
 				}
 				return true;
 				return true;
 			case Key.CursorLeft:
 			case Key.CursorLeft:
@@ -161,12 +165,15 @@ namespace Terminal.Gui {
 				if (old != Focused) {
 				if (old != Focused) {
 					old?.SetNeedsDisplay ();
 					old?.SetNeedsDisplay ();
 					Focused?.SetNeedsDisplay ();
 					Focused?.SetNeedsDisplay ();
+				} else {
+					FocusNearestView (GetSuperViewSubviews (false), false);
 				}
 				}
 				return true;
 				return true;
 
 
 			case Key.ControlL:
 			case Key.ControlL:
 				Application.Refresh ();
 				Application.Refresh ();
 				return true;
 				return true;
+
 			}
 			}
 			return false;
 			return false;
 		}
 		}