|
@@ -9,7 +9,7 @@ from typing import Any, Callable, Iterable, List, Union
|
|
|
|
|
|
import urwid
|
|
import urwid
|
|
from additional_urwid_widgets import IndicativeListBox
|
|
from additional_urwid_widgets import IndicativeListBox
|
|
-from itertools import chain
|
|
|
|
|
|
+from itertools import chain, product
|
|
from urwid import numedit
|
|
from urwid import numedit
|
|
from urwid.wimp import PopUpLauncher
|
|
from urwid.wimp import PopUpLauncher
|
|
|
|
|
|
@@ -170,13 +170,13 @@ class FocusWidget(urwid.WidgetWrap):
|
|
for idx, w in enumerate(c.contents):
|
|
for idx, w in enumerate(c.contents):
|
|
yield self.find_widget(widget=w[0]), [*path, idx]
|
|
yield self.find_widget(widget=w[0]), [*path, idx]
|
|
|
|
|
|
-
|
|
|
|
def advance_focus(self, reverse=False):
|
|
def advance_focus(self, reverse=False):
|
|
_c = self.container.get_focus_path()
|
|
_c = self.container.get_focus_path()
|
|
- _p = [
|
|
|
|
- x[1] for x in filter(lambda x: x[0] is not None,
|
|
|
|
- self.iter_focus_paths())
|
|
|
|
- ]
|
|
|
|
|
|
+ _p = [ x[1] for w,x in product(self._focus_widgets, [x for x in filter(
|
|
|
|
+ lambda x: x[0] is not None,
|
|
|
|
+ self.iter_focus_paths()
|
|
|
|
+ )]) if x[0] is w ]
|
|
|
|
+
|
|
for _prev, _cur, _next in zip([_p[-1], *_p[:-1]], _p, [*_p[1:], _p[0]]):
|
|
for _prev, _cur, _next in zip([_p[-1], *_p[:-1]], _p, [*_p[1:], _p[0]]):
|
|
if list(_c) == list(_cur):
|
|
if list(_c) == list(_cur):
|
|
break
|
|
break
|