Skip to content

Commit 530addc

Browse files
ryneeverettpazz
authored andcommitted
mimetree-rebase: FocusText -> ANSIText (See #1015)
1 parent 88a278a commit 530addc

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

alot/commands/thread.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,6 @@ def matches(msgt):
590590
mimetree = not mt.display_mimetree \
591591
if self.mimetree == 'toggle' else self.mimetree
592592

593-
594593
# collapse/expand depending on new 'visible' value
595594
if visible is False:
596595
mt.collapse(mt.root)

alot/widgets/thread.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
from ..db.utils import decode_header, X_SIGNATURE_MESSAGE_HEADER
1717
from ..helper import string_sanitize
1818

19+
ANSI_BACKGROUND = settings.get("interpret_ansi_background")
20+
1921

2022
class MessageSummaryWidget(urwid.WidgetWrap):
2123
"""
@@ -80,17 +82,16 @@ def __init__(self, content, attr=None, attr_focus=None):
8082
for each line in content.
8183
"""
8284
structure = []
83-
ansi_background = settings.get("interpret_ansi_background")
8485

8586
# depending on this config setting, we either add individual lines
8687
# or the complete context as focusable objects.
8788
if settings.get('thread_focus_linewise'):
8889
for line in content.splitlines():
8990
structure.append((ANSIText(line, attr, attr_focus,
90-
ansi_background), None))
91+
ANSI_BACKGROUND), None))
9192
else:
9293
structure.append((ANSIText(content, attr, attr_focus,
93-
ansi_background), None))
94+
ANSI_BACKGROUND), None))
9495
SimpleTree.__init__(self, structure)
9596

9697

@@ -334,7 +335,7 @@ def _text_tree_to_widget_tree(self, tree):
334335
att = settings.get_theming_attribute('thread', 'body')
335336
att_focus = settings.get_theming_attribute('thread', 'body_focus')
336337
label, subtrees = tree
337-
label = FocusableText(label, att, att_focus)
338+
label = ANSIText(label, att, att_focus, ANSI_BACKGROUND)
338339
if subtrees is None:
339340
return label, None
340341
else:

0 commit comments

Comments
 (0)