diff options
author | Anton Khirnov <anton@khirnov.net> | 2020-02-25 18:30:31 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2020-02-25 18:30:31 +0100 |
commit | 8422972845bed9253d7a5dad2b901fa4247708cd (patch) | |
tree | ce3341e823d39f752a1ee31c55e480383b0d9894 /alot/widgets | |
parent | c3bd46cd204466038401365ef229c747b2c4242c (diff) |
thread buffer: make attachments work again
Diffstat (limited to 'alot/widgets')
-rw-r--r-- | alot/widgets/thread.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/alot/widgets/thread.py b/alot/widgets/thread.py index 1954d84d..7c423383 100644 --- a/alot/widgets/thread.py +++ b/alot/widgets/thread.py @@ -163,8 +163,6 @@ class MessageWidget(urwid.WidgetWrap): """ self._message = message - self.display_attachments = True - self._headers_wgt = self._get_headers() self._summary_wgt = MessageSummaryWidget(message, odd) self._source_wgt = self._get_source() @@ -329,6 +327,15 @@ class MessageWidget(urwid.WidgetWrap): """ self.display_content = not self._message.matches(querystring) + def get_selected_attachment(self): + """ + If an AttachmentWidget is currently focused, return it. Otherwise return + None. + """ + if self._w.focus is self._attach_wgt: + return self._attach_wgt.focus.attachment + return None + class ThreadNode(urwid.WidgetWrap): _ARROW = '➤' _HBAR = '─' |