Skip to content

Commit

Permalink
mimetree-rebase: FocusText -> ANSIText (See pazz#1015)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryneeverett committed Mar 23, 2020
1 parent 514b82f commit aaff899
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion alot/commands/thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,6 @@ def matches(msgt):
mimetree = not mt.display_mimetree \
if self.mimetree == 'toggle' else self.mimetree


# collapse/expand depending on new 'visible' value
if visible is False:
mt.collapse(mt.root)
Expand Down
9 changes: 5 additions & 4 deletions alot/widgets/thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
from ..db.utils import decode_header, X_SIGNATURE_MESSAGE_HEADER
from ..helper import string_sanitize

ANSI_BACKGROUND = settings.get("interpret_ansi_background")


class MessageSummaryWidget(urwid.WidgetWrap):
"""
Expand Down Expand Up @@ -80,17 +82,16 @@ def __init__(self, content, attr=None, attr_focus=None):
for each line in content.
"""
structure = []
ansi_background = settings.get("interpret_ansi_background")

# depending on this config setting, we either add individual lines
# or the complete context as focusable objects.
if settings.get('thread_focus_linewise'):
for line in content.splitlines():
structure.append((ANSIText(line, attr, attr_focus,
ansi_background), None))
ANSI_BACKGROUND), None))
else:
structure.append((ANSIText(content, attr, attr_focus,
ansi_background), None))
ANSI_BACKGROUND), None))
SimpleTree.__init__(self, structure)


Expand Down Expand Up @@ -334,7 +335,7 @@ def _text_tree_to_widget_tree(self, tree):
att = settings.get_theming_attribute('thread', 'body')
att_focus = settings.get_theming_attribute('thread', 'body_focus')
label, subtrees = tree
label = FocusableText(label, att, att_focus)
label = ANSIText(label, att, att_focus, ANSI_BACKGROUND)
if subtrees is None:
return label, None
else:
Expand Down

0 comments on commit aaff899

Please sign in to comment.