summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2012-01-07 17:17:39 +0000
committerPatrick Totzke <patricktotzke@gmail.com>2012-01-07 17:17:39 +0000
commit23e32ea957e2d17deed1e75723b349a370fc195d (patch)
tree5177c2b68ef8299920bfec9720f1a010ca2ccaab /alot
parentdbf341defed3d1158778611f157945b0ce554381 (diff)
display outstanding tags in MessageSumary line
where outstanding means those tats present in the message but not for every message in its thread. issue #212, #27
Diffstat (limited to 'alot')
-rw-r--r--alot/widgets.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/alot/widgets.py b/alot/widgets.py
index 17141917..79bab28b 100644
--- a/alot/widgets.py
+++ b/alot/widgets.py
@@ -580,9 +580,20 @@ class MessageSummaryWidget(urwid.WidgetWrap):
attr = 'thread_summary_even'
else:
attr = 'thread_summary_odd'
+ cols = []
+
sumstr = self.__str__()
- txt = urwid.AttrMap(urwid.Text(sumstr), attr, 'thread_summary_focus')
- urwid.WidgetWrap.__init__(self, txt)
+ txt = urwid.Text(sumstr)
+ cols.append(txt)
+
+ thread_tags = message.get_thread().get_tags(intersection=True)
+ outstanding_tags = set(message.get_tags()).difference(thread_tags)
+ tag_widgets = [TagWidget(t) for t in outstanding_tags]
+ tag_widgets.sort(tag_cmp, lambda tag_widget: tag_widget.translated)
+ for tag_widget in tag_widgets:
+ cols.append(('fixed', tag_widget.width(), tag_widget))
+ line = urwid.AttrMap(urwid.Columns(cols, dividechars=1), attr, 'thread_summary_focus')
+ urwid.WidgetWrap.__init__(self, line)
def __str__(self):
author, address = self.message.get_author()