diff options
author | Ian Ward <ian@excess.org> | 2014-10-17 11:26:22 -0400 |
---|---|---|
committer | Ian Ward <ian@excess.org> | 2014-10-17 11:26:22 -0400 |
commit | 68c4e0fe9aa3b274cebc28b0470a5541d28d2442 (patch) | |
tree | b90ff57c7f82eb81f3436f08a607ca1e66002f52 | |
parent | d4c553dee24a090b63245a07fef4f1bf6f052a72 (diff) | |
parent | ebcf35d307500dbc9654fe3ec818c5924f8c3b77 (diff) | |
download | urwid-68c4e0fe9aa3b274cebc28b0470a5541d28d2442.tar.gz |
Merge pull request #74 from jeblair/master
Fix GridFlow focus issue
-rwxr-xr-x | urwid/container.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/urwid/container.py b/urwid/container.py index 8b61383..3999f28 100755 --- a/urwid/container.py +++ b/urwid/container.py @@ -342,14 +342,18 @@ class GridFlow(WidgetWrap, WidgetContainerMixin, WidgetContainerListContentsMixi if self.v_sep: p.contents.append((divider, p.options())) c = Columns([], self.h_sep) + column_focused = False pad = Padding(c, self.align) # extra attribute to reference contents position pad.first_position = i p.contents.append((pad, p.options())) c.contents.append((w, c.options(GIVEN, width_amount))) - if i == self.focus_position: + if ((i == self.focus_position) or + (not column_focused and w.selectable())): c.focus_position = len(c.contents) - 1 + column_focused = True + if i == self.focus_position: p.focus_position = len(p.contents) - 1 used_space = (sum(x[1][1] for x in c.contents) + self.h_sep * len(c.contents)) |