summaryrefslogtreecommitdiff
path: root/alot/widgets/thread.py
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2013-01-31 20:09:09 +0000
committerPatrick Totzke <patricktotzke@gmail.com>2013-03-03 13:48:20 +0000
commitcf728266ca2eaf52ea80d6b7b87fda71acaedc0a (patch)
tree29a8bcc44153f7e936e103d9f0102bc4f1e78874 /alot/widgets/thread.py
parent9ffff6ecc0762e59412c3399e86d5f6104176ada (diff)
update MessageTree -- include body
Diffstat (limited to 'alot/widgets/thread.py')
-rw-r--r--alot/widgets/thread.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/alot/widgets/thread.py b/alot/widgets/thread.py
index eee1c410..0d98c031 100644
--- a/alot/widgets/thread.py
+++ b/alot/widgets/thread.py
@@ -14,7 +14,7 @@ from alot.helper import tag_cmp
from alot.widgets.globals import HeadersList
from alot.widgets.globals import TagWidget
from alot.widgets.globals import AttachmentWidget
-from alot.foreign.urwidtrees import Tree, SimpleTree
+from alot.foreign.urwidtrees import Tree, SimpleTree, CollapsibleTree
from alot.db.utils import extract_body
@@ -315,17 +315,20 @@ class MessageBodyWidget(urwid.AttrMap):
att = settings.get_theming_attribute('thread', 'body')
urwid.AttrMap.__init__(self, urwid.Text(bodytxt), att)
-class MessageTree(SimpleTree):
+class MessageTree(CollapsibleTree):
def __init__(self, message):
self._message = message
structure = [
- (MessageSummaryWidget(message), #None
+ (MessageSummaryWidget(message),
[
(MessageBodyWidget(message), None),
]
)
]
- SimpleTree.__init__(self, structure)
+ CollapsibleTree.__init__(self, SimpleTree(structure))
+
+ def collapse_if_matches(self, querystring):
+ self.set_position_collapsed(self.root,self._message.matches(querystring))
class ThreadTree(Tree):
def __init__(self, thread):