aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoni Marti <koni.marti@gmail.com>2023-07-14 20:37:33 +0200
committerRobin Jarry <robin@jarry.cc>2023-07-16 10:13:19 +0200
commit995dfc15a8065fdc01e0ace8cef7174e0749722e (patch)
treed0c1843a0d6695df4dd8c9ea5d76164f637fd072
parentb267de83e38c09d34215e7a33991ae5c111fe649 (diff)
downloadaerc-995dfc15a8065fdc01e0ace8cef7174e0749722e.tar.gz
aerc-995dfc15a8065fdc01e0ace8cef7174e0749722e.zip
styles: add style for folded threads
Add a style for folded threads. Use msglist_thread_folded in the stylesheet like "msglist_thread_folded.dim = true" Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc> Tested-by: inwit <inwit@sindominio.net>
-rw-r--r--config/style.go3
-rw-r--r--widgets/msglist.go5
2 files changed, 8 insertions, 0 deletions
diff --git a/config/style.go b/config/style.go
index 511cdb3a..417f42b6 100644
--- a/config/style.go
+++ b/config/style.go
@@ -39,6 +39,7 @@ const (
STYLE_MSGLIST_MARKED
STYLE_MSGLIST_RESULT
STYLE_MSGLIST_ANSWERED
+ STYLE_MSGLIST_THREAD_FOLDED
STYLE_DIRLIST_DEFAULT
STYLE_DIRLIST_UNREAD
@@ -81,6 +82,8 @@ var StyleNames = map[string]StyleObject{
"msglist_result": STYLE_MSGLIST_RESULT,
"msglist_answered": STYLE_MSGLIST_ANSWERED,
+ "msglist_thread_folded": STYLE_MSGLIST_THREAD_FOLDED,
+
"dirlist_default": STYLE_DIRLIST_DEFAULT,
"dirlist_unread": STYLE_DIRLIST_UNREAD,
"dirlist_recent": STYLE_DIRLIST_RECENT,
diff --git a/widgets/msglist.go b/widgets/msglist.go
index 9ce60756..8263b945 100644
--- a/widgets/msglist.go
+++ b/widgets/msglist.go
@@ -205,6 +205,11 @@ func addMessage(
if store.IsResult(msg.Uid) {
params.styles = append(params.styles, config.STYLE_MSGLIST_RESULT)
}
+ // folded thread
+ templateData, ok := data.(models.TemplateData)
+ if ok && templateData.ThreadFolded() {
+ params.styles = append(params.styles, config.STYLE_MSGLIST_THREAD_FOLDED)
+ }
// marked message
marked := store.Marker().IsMarked(msg.Uid)
if marked {