|
16 | 16 | from ..db.utils import decode_header, X_SIGNATURE_MESSAGE_HEADER |
17 | 17 | from ..helper import string_sanitize |
18 | 18 |
|
| 19 | +ANSI_BACKGROUND = settings.get("interpret_ansi_background") |
| 20 | + |
19 | 21 |
|
20 | 22 | class MessageSummaryWidget(urwid.WidgetWrap): |
21 | 23 | """ |
@@ -80,17 +82,16 @@ def __init__(self, content, attr=None, attr_focus=None): |
80 | 82 | for each line in content. |
81 | 83 | """ |
82 | 84 | structure = [] |
83 | | - ansi_background = settings.get("interpret_ansi_background") |
84 | 85 |
|
85 | 86 | # depending on this config setting, we either add individual lines |
86 | 87 | # or the complete context as focusable objects. |
87 | 88 | if settings.get('thread_focus_linewise'): |
88 | 89 | for line in content.splitlines(): |
89 | 90 | structure.append((ANSIText(line, attr, attr_focus, |
90 | | - ansi_background), None)) |
| 91 | + ANSI_BACKGROUND), None)) |
91 | 92 | else: |
92 | 93 | structure.append((ANSIText(content, attr, attr_focus, |
93 | | - ansi_background), None)) |
| 94 | + ANSI_BACKGROUND), None)) |
94 | 95 | SimpleTree.__init__(self, structure) |
95 | 96 |
|
96 | 97 |
|
@@ -334,7 +335,7 @@ def _text_tree_to_widget_tree(self, tree): |
334 | 335 | att = settings.get_theming_attribute('thread', 'body') |
335 | 336 | att_focus = settings.get_theming_attribute('thread', 'body_focus') |
336 | 337 | label, subtrees = tree |
337 | | - label = FocusableText(label, att, att_focus) |
| 338 | + label = ANSIText(label, att, att_focus, ANSI_BACKGROUND) |
338 | 339 | if subtrees is None: |
339 | 340 | return label, None |
340 | 341 | else: |
|
0 commit comments