Merge pull request #243 from CanonicalLtd/mwhudson/enter-next-field
have enter advance to the next focus item in piles and listboxes
This commit is contained in:
commit
64ec13fc98
|
@ -95,8 +95,11 @@ class TabCyclingMixin:
|
|||
else:
|
||||
return key
|
||||
|
||||
enter_advancing_command_map = urwid.command_map.copy()
|
||||
enter_advancing_command_map['enter'] = 'next selectable'
|
||||
|
||||
class TabCyclingPile(TabCyclingMixin, urwid.Pile):
|
||||
_command_map = enter_advancing_command_map
|
||||
pass
|
||||
|
||||
class TabCyclingColumns(TabCyclingMixin, urwid.Columns):
|
||||
|
@ -104,6 +107,7 @@ class TabCyclingColumns(TabCyclingMixin, urwid.Columns):
|
|||
|
||||
|
||||
class TabCyclingListBox(urwid.ListBox):
|
||||
_command_map = enter_advancing_command_map
|
||||
# It feels like it ought to be possible to write TabCyclingMixin
|
||||
# so it works for a ListBox as well, but it seems to be just
|
||||
# awkward enough to make the repeated code the easier and clearer
|
||||
|
|
Loading…
Reference in New Issue