diff options
author | Tim Culverhouse <tim@timculverhouse.com> | 2023-09-25 09:07:43 -0500 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-09-27 23:12:41 +0200 |
commit | 4ec1e1a5e4c74236a6d1992c8778c39fd25d847b (patch) | |
tree | b6ade84273558cf6c03ae8e7b606c3d2edd998ab /widgets/msglist.go | |
parent | 439204d994e8ba9ab3045139bc716bee812f4029 (diff) | |
download | aerc-4ec1e1a5e4c74236a6d1992c8778c39fd25d847b.tar.gz |
ui: enable showing of thread-context
Add a UI config value to enable showing of "thread-context", similar
to `notmuch show --entire-thread=true`. Add an associated style called
"msglist_thread_context" which can be used to style such messages.
Currently this feature is only supported by notmuch. It would be
possible for maildir to implement as well, IMAP with gmail custom
extensions, and JMAP. This patch merely implements the notmuch version
and puts the groundwork in for handling these sorts of displays.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Tested-by: Inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'widgets/msglist.go')
-rw-r--r-- | widgets/msglist.go | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/widgets/msglist.go b/widgets/msglist.go index dcb4cd31..3187b5d5 100644 --- a/widgets/msglist.go +++ b/widgets/msglist.go @@ -209,8 +209,13 @@ func addMessage( } // folded thread templateData, ok := data.(models.TemplateData) - if ok && templateData.ThreadFolded() { - params.styles = append(params.styles, config.STYLE_MSGLIST_THREAD_FOLDED) + if ok { + if templateData.ThreadFolded() { + params.styles = append(params.styles, config.STYLE_MSGLIST_THREAD_FOLDED) + } + if templateData.ThreadContext() { + params.styles = append(params.styles, config.STYLE_MSGLIST_THREAD_CONTEXT) + } } // marked message marked := store.Marker().IsMarked(msg.Uid) @@ -476,7 +481,7 @@ func newThreadView(store *lib.MessageStore) *threadView { } func (t *threadView) Update(data state.DataSetter, uid uint32) { - prefix, same, count, folded := "", false, 0, false + prefix, same, count, folded, context := "", false, 0, false, false thread, err := t.store.Thread(uid) if thread != nil && err == nil { prefix = threadPrefix(thread, t.reverse, true) @@ -486,6 +491,7 @@ func (t *threadView) Update(data state.DataSetter, uid uint32) { t.prevSubj = subject count = countThreads(thread) folded = thread.FirstChild != nil && thread.FirstChild.Hidden + context = thread.Context } - data.SetThreading(prefix, same, count, folded) + data.SetThreading(prefix, same, count, folded, context) } |