mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
Merge pull request #865 from BDisp/frameview-tab-fix
Fixes #864. FrameView has only one contentView now.
This commit is contained in:
@@ -182,7 +182,7 @@ namespace Terminal.Gui {
|
||||
case Key.CursorRight:
|
||||
case Key.CursorDown:
|
||||
case Key.ControlI: // Unix
|
||||
var old = Focused;
|
||||
var old = GetDeepestFocusedSubview (Focused);
|
||||
if (!FocusNext ())
|
||||
FocusNext ();
|
||||
if (old != Focused) {
|
||||
@@ -195,7 +195,7 @@ namespace Terminal.Gui {
|
||||
case Key.CursorLeft:
|
||||
case Key.CursorUp:
|
||||
case Key.BackTab:
|
||||
old = Focused;
|
||||
old = GetDeepestFocusedSubview (Focused);
|
||||
if (!FocusPrev ())
|
||||
FocusPrev ();
|
||||
if (old != Focused) {
|
||||
@@ -213,6 +213,16 @@ namespace Terminal.Gui {
|
||||
return false;
|
||||
}
|
||||
|
||||
View GetDeepestFocusedSubview (View view)
|
||||
{
|
||||
foreach (var v in view.Subviews) {
|
||||
if (v.HasFocus) {
|
||||
return GetDeepestFocusedSubview (v);
|
||||
}
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
IEnumerable<View> GetToplevelSubviews (bool isForward)
|
||||
{
|
||||
if (SuperView == null) {
|
||||
|
||||
@@ -92,8 +92,10 @@ namespace Terminal.Gui {
|
||||
|
||||
void Initialize ()
|
||||
{
|
||||
base.Add (contentView);
|
||||
contentView.Text = base.Text;
|
||||
if (Subviews?.Count == 0) {
|
||||
base.Add (contentView);
|
||||
contentView.Text = base.Text;
|
||||
}
|
||||
}
|
||||
|
||||
void DrawFrame ()
|
||||
|
||||
Reference in New Issue
Block a user