summaryrefslogtreecommitdiff
path: root/alot/widgets
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-05-05 11:33:07 +0200
committerAnton Khirnov <anton@khirnov.net>2020-05-05 11:33:07 +0200
commit05d796026155a5c596f23ec899b577ba83d790be (patch)
tree239198b7364c028e35a64916aaad3267c08fcd93 /alot/widgets
parent8ce767fe63cd8a89f243671ae0ada8975c2c7639 (diff)
widgets/thread: merge _reassemble into display_source handling
It is the only place it is still called from.
Diffstat (limited to 'alot/widgets')
-rw-r--r--alot/widgets/thread.py29
1 files changed, 13 insertions, 16 deletions
diff --git a/alot/widgets/thread.py b/alot/widgets/thread.py
index dd179ed9..e2328b16 100644
--- a/alot/widgets/thread.py
+++ b/alot/widgets/thread.py
@@ -421,21 +421,6 @@ class MessageWidget(urwid.WidgetWrap):
def get_message(self):
return self._message
- def _reassemble(self, display_source):
- widgets = []
-
- if display_source:
- widgets.append(self._source_wgt)
- else:
- widgets.append(self._headers_wgt)
-
- if self._attach_wgt is not None:
- widgets.append(self._attach_wgt)
-
- widgets.append(self._body_wgt)
-
- self._w.body[:] = widgets
-
def _get_headers(self):
key_attr = settings.get_theming_attribute('thread', 'header_key')
value_attr = settings.get_theming_attribute('thread', 'header_value')
@@ -501,7 +486,19 @@ class MessageWidget(urwid.WidgetWrap):
if val == self._display_source:
return
- self._reassemble(val)
+ widgets = []
+ if val:
+ widgets.append(self._source_wgt)
+ else:
+ widgets.append(self._headers_wgt)
+
+ if self._attach_wgt is not None:
+ widgets.append(self._attach_wgt)
+
+ widgets.append(self._body_wgt)
+
+ self._w.body[:] = widgets
+
self._display_source = val
@property