Build the focus chain from focusable widgets

Rather than it being about widgets where `can_focus` is `True`, have it be
about widgets that are currently able to receive focus. Before this change
widgets with a positive `can_focus` but which were disabled would still end
up in the chain.
This commit is contained in:
Dave Pearson
2023-02-13 15:44:02 +00:00
parent 8379945b60
commit 0171ad7c85

View File

@@ -177,7 +177,7 @@ class Screen(Widget):
else:
if node.is_container and node.can_focus_children:
push(iter(node.focusable_children))
if node.can_focus:
if node.focusable:
add_widget(node)
return widgets