Terminal.Gui
Terminal.Gui copied to clipboard
Fix focus and keyboard nav with `Adornments`
Right now, in #3323, mouse works but
- Focus does not
- Keyboard does not work well
How should Focus work?
Because Padding is in a different view hierarchy from the dialog, Tab etc... doesn't tab into the buttons.
Padding - Any views added to Padding are included in Padding.Parent's focus chain. If View.Subviews[^1].HasFocus and the user presses Tab Padding.SubViews[0] will get focus. Etc...
Border - Ctrl-F10 is used to set focus on Border.Subviews[0]. Subsequent Tab presses cycle through Border.Subviews. Ctrl-F10 again returns focus to Border.Parent.
Margin - No default behavior. If someone adds views to Margin they are on their own to figure out a focus model (I can't think of any use case where it makes sense to add a subview to Margin.