diff options
| author | Shivesh Mandalia <mail@shivesh.org> | 2021-10-24 16:00:14 +0100 |
|---|---|---|
| committer | Shivesh Mandalia <mail@shivesh.org> | 2021-10-24 16:00:14 +0100 |
| commit | c1c8d1ff30485019323ad87c628229f1016941ac (patch) | |
| tree | 5001513c329b3c4f9d52f361fa95ffa820a8aaeb /widgets/msglist.go | |
| parent | 5c7d4873908f28dde33013d10543e4cf1417525b (diff) | |
| download | aerc-c1c8d1ff30485019323ad87c628229f1016941ac.tar.gz aerc-c1c8d1ff30485019323ad87c628229f1016941ac.zip | |
Stylesheet colour mapping for custom IMAP flagsshivesh
Diffstat (limited to 'widgets/msglist.go')
| -rw-r--r-- | widgets/msglist.go | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/widgets/msglist.go b/widgets/msglist.go index 8f5a06e..90cfe33 100644 --- a/widgets/msglist.go +++ b/widgets/msglist.go @@ -115,12 +115,35 @@ func (ml *MessageList) Draw(ctx *ui.Context) { // unread message seen := false flagged := false + important := false + list := false + food := false + personal := false + work := false + physics := false + todo := false + later := false for _, flag := range msg.Flags { switch flag { case models.SeenFlag: seen = true case models.FlaggedFlag: flagged = true + // NOTE(shivesh): my custom flags + case models.ImportantFlag: + important = true + case models.ListFlag: + list = true + case models.PersonalFlag: + personal = true + case models.WorkFlag: + work = true + case models.PhysicsFlag: + physics = true + case models.TodoFlag: + todo = true + case models.LaterFlag: + later = true } } @@ -133,6 +156,30 @@ func (ml *MessageList) Draw(ctx *ui.Context) { if flagged { msg_styles = append(msg_styles, config.STYLE_MSGLIST_FLAGGED) } + if important { + msg_styles = append(msg_styles, config.STYLE_MSGLIST_IMPORTANT) + } + if list { + msg_styles = append(msg_styles, config.STYLE_MSGLIST_LIST) + } + if food { + msg_styles = append(msg_styles, config.STYLE_MSGLIST_FOOD) + } + if personal { + msg_styles = append(msg_styles, config.STYLE_MSGLIST_PERSONAL) + } + if work { + msg_styles = append(msg_styles, config.STYLE_MSGLIST_WORK) + } + if physics { + msg_styles = append(msg_styles, config.STYLE_MSGLIST_PHYSICS) + } + if todo { + msg_styles = append(msg_styles, config.STYLE_MSGLIST_TODO) + } + if later { + msg_styles = append(msg_styles, config.STYLE_MSGLIST_LATER) + } // deleted message if _, ok := store.Deleted[msg.Uid]; ok { |
