summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
Diffstat (limited to 'alot')
-rw-r--r--alot/defaults/default.theme5
-rw-r--r--alot/defaults/theme.spec6
-rw-r--r--alot/widgets/thread.py31
3 files changed, 24 insertions, 18 deletions
diff --git a/alot/defaults/default.theme b/alot/defaults/default.theme
index 7abaecc6..852e5b2a 100644
--- a/alot/defaults/default.theme
+++ b/alot/defaults/default.theme
@@ -39,6 +39,11 @@
header_key = 'default','','white','dark gray','white','dark gray'
header_value = 'default','','light gray','dark gray','light gray','dark gray'
+ crypt_trusted = '', '', 'dark green', '', 'dark green', ''
+ crypt_untrusted = '', '', 'brown', '', 'brown', ''
+ crypt_unsigned = '', '', 'dark cyan', '', 'dark cyan', ''
+ crypt_invalid = '', '', 'dark red', '', 'dark red', ''
+
[[summary]]
even = 'default','','white','light blue','white','#006'
odd = 'default','','white','dark blue','white','#068'
diff --git a/alot/defaults/theme.spec b/alot/defaults/theme.spec
index b03b61d4..c1298bf9 100644
--- a/alot/defaults/theme.spec
+++ b/alot/defaults/theme.spec
@@ -60,6 +60,12 @@
header = attrtriple
header_key = attrtriple
header_value = attrtriple
+
+ crypt_trusted = attrtriple
+ crypt_untrusted = attrtriple
+ crypt_unsigned = attrtriple
+ crypt_invalid = attrtriple
+
[[summary]]
even = attrtriple
odd = attrtriple
diff --git a/alot/widgets/thread.py b/alot/widgets/thread.py
index 5852967d..09dd15fe 100644
--- a/alot/widgets/thread.py
+++ b/alot/widgets/thread.py
@@ -156,30 +156,25 @@ class _MessageBodyWidget(urwid.WidgetWrap):
text_parts.append(desc + ' MIME part')
if mime_tree.is_signed and mime_tree.sig_valid:
- trust = 'trusted' if mime_tree.sig_trusted else 'untrusted'
- t = 'valid signature from: %s (%s)' % (mime_tree.signer_id, trust)
+ if mime_tree.sig_trusted:
+ trust = 'trusted'
+ attr_name = 'crypt_trusted'
+ else:
+ trust = 'untrusted'
+ attr_name = 'crypt_untrusted'
+
+ t = 'valid %s signature from "%s"' % (trust, mime_tree.signer_id)
text_parts.append(t)
+ else:
+ attr_name = 'crypt_unsigned'
if mime_tree.crypt_error:
text_parts.append('crypto processing error: ' + mime_tree.crypt_error)
-
- header = urwid.Columns([])
-
- div_down = urwid.Divider('↓')
- div_up = urwid.Divider('↑')
- hdr_sep = (div_down, ('weight', 1, False))
-
- header.contents.append(hdr_sep)
-
- for t in text_parts:
- header.contents.append((urwid.Text(t), ('pack', None, False)))
- header.contents.append(hdr_sep)
-
- footer = div_up
+ attr_name = 'crypt_invalid'
body = self._build_body(mime_tree.children[0])
-
- return urwid.Pile([header, body, footer])
+ attr = settings.get_theming_attribute('thread', attr_name)
+ return urwid.AttrMap(urwid.LineBox(body, title = ':'.join(text_parts)), attr)
def _render_plain_text(self, text):
attr_text = settings.get_theming_attribute('thread', 'body')