diff options
author | Martin Lucina <martin@lucina.net> | 2023-01-09 17:28:19 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-01-10 21:37:40 +0100 |
commit | 89681ba1f2b9316de4d3305c37ef59f9c5f34793 (patch) | |
tree | 3a67c76ac9a36d5b77b8f8c0a553f7dd300fefe8 | |
parent | 6de51bad583b9ca194953d9d24e1a683c737a4b4 (diff) | |
download | aerc-89681ba1f2b9316de4d3305c37ef59f9c5f34793.tar.gz |
style: add msglist_answered config option
Add a style for messages that have been marked as answered, and a
"msglist_answered" config option for it.
Signed-off-by: Martin Lucina <martin@lucina.net>
Acked-by: Robin Jarry <robin@jarry.cc>
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | config/style.go | 16 | ||||
-rw-r--r-- | doc/aerc-stylesets.7.scd | 3 | ||||
-rw-r--r-- | widgets/msglist.go | 3 |
4 files changed, 16 insertions, 7 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 22e3032f..9d8db972 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Added - New column-based message list format with `index-columns`. +- Add a `msglist_answered` style for answered messages. ### Deprecated diff --git a/config/style.go b/config/style.go index 30351a24..3e4a9597 100644 --- a/config/style.go +++ b/config/style.go @@ -37,6 +37,7 @@ const ( STYLE_MSGLIST_DELETED STYLE_MSGLIST_MARKED STYLE_MSGLIST_RESULT + STYLE_MSGLIST_ANSWERED STYLE_DIRLIST_DEFAULT STYLE_DIRLIST_UNREAD @@ -70,13 +71,14 @@ var StyleNames = map[string]StyleObject{ "statusline_warning": STYLE_STATUSLINE_WARNING, "statusline_success": STYLE_STATUSLINE_SUCCESS, - "msglist_default": STYLE_MSGLIST_DEFAULT, - "msglist_unread": STYLE_MSGLIST_UNREAD, - "msglist_read": STYLE_MSGLIST_READ, - "msglist_flagged": STYLE_MSGLIST_FLAGGED, - "msglist_deleted": STYLE_MSGLIST_DELETED, - "msglist_marked": STYLE_MSGLIST_MARKED, - "msglist_result": STYLE_MSGLIST_RESULT, + "msglist_default": STYLE_MSGLIST_DEFAULT, + "msglist_unread": STYLE_MSGLIST_UNREAD, + "msglist_read": STYLE_MSGLIST_READ, + "msglist_flagged": STYLE_MSGLIST_FLAGGED, + "msglist_deleted": STYLE_MSGLIST_DELETED, + "msglist_marked": STYLE_MSGLIST_MARKED, + "msglist_result": STYLE_MSGLIST_RESULT, + "msglist_answered": STYLE_MSGLIST_ANSWERED, "dirlist_default": STYLE_DIRLIST_DEFAULT, "dirlist_unread": STYLE_DIRLIST_UNREAD, diff --git a/doc/aerc-stylesets.7.scd b/doc/aerc-stylesets.7.scd index 34bbf4af..2ccadd60 100644 --- a/doc/aerc-stylesets.7.scd +++ b/doc/aerc-stylesets.7.scd @@ -103,6 +103,8 @@ styling. : The messages with the marked flag. | *msglist_result* : The messages which match the current search. +| *msglist_answered* +: The messages marked as answered. | *dirlist_default* : The default style for directories in the directory list. | *dirlist_unread* @@ -183,6 +185,7 @@ The order that *msglist_\** styles are applied in is, from first to last: . *msglist_default* . *msglist_unread* . *msglist_read* +. *msglist_answered* . *msglist_flagged* . *msglist_deleted* . *msglist_marked* diff --git a/widgets/msglist.go b/widgets/msglist.go index 169fb310..fffea99e 100644 --- a/widgets/msglist.go +++ b/widgets/msglist.go @@ -238,6 +238,9 @@ func addMessage( } else { params.styles = append(params.styles, config.STYLE_MSGLIST_UNREAD) } + if msg.Flags.Has(models.AnsweredFlag) { + params.styles = append(params.styles, config.STYLE_MSGLIST_ANSWERED) + } if msg.Flags.Has(models.FlaggedFlag) { params.styles = append(params.styles, config.STYLE_MSGLIST_FLAGGED) } |