Skip to content

Commit

Permalink
Fix MessageSummaryWidget's child TagWidget rendering.
Browse files Browse the repository at this point in the history
Fixes #1433
  • Loading branch information
Mārtiņš Mačs authored and pazz committed May 13, 2020
1 parent d9533f1 commit 73a1856
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions alot/widgets/thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,19 @@ def __init__(self, message, even=True):
cols.append(('fixed', tag_widget.width(), tag_widget))
line = urwid.AttrMap(urwid.Columns(cols, dividechars=1), attr,
focus_att)

# In case when an e-mail has multiple tags, Urwid assumes that only
# one of the summary line's TagWidget-s can be focused. Which means
# that when the summary line is focused, only one TagWidget is rendered
# as focused and the rest of them as unfocused. This forces to render
# all TagWidget-s as focused. Issue #1433
def _render_wrap(size, focus=False):
for c in cols:
if isinstance(c, tuple):
c[2].set_map('focus' if focus else 'normal')
return urwid.AttrMap.render(line, size, focus)
line.render = _render_wrap

urwid.WidgetWrap.__init__(self, line)

def __str__(self):
Expand Down

0 comments on commit 73a1856

Please sign in to comment.