From aab91ae9f730a2d385ee6277fc5ebffa38f39ff4 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Tue, 20 Oct 2020 16:19:45 +0200 Subject: widgets/thread: simplify code --- alot/widgets/thread.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'alot/widgets/thread.py') diff --git a/alot/widgets/thread.py b/alot/widgets/thread.py index 2af22b07..35024d34 100644 --- a/alot/widgets/thread.py +++ b/alot/widgets/thread.py @@ -562,11 +562,8 @@ class ThreadNode(urwid.WidgetWrap): _have_next_sibling = None def __init__(self, msg, thread, pos, indent): - if pos & 1: - attr = settings.get_theming_attribute('thread', 'summary', 'odd') - else: - attr = settings.get_theming_attribute('thread', 'summary', 'even') - + parity = 'odd' if pos & 1 else 'even' + attr = settings.get_theming_attribute('thread', 'summary', parity) attr_focus = settings.get_theming_attribute('thread', 'summary', 'focus') msg_summary = MessageSummaryWidget(msg, attr, attr_focus) -- cgit v1.2.3