From 43df87552c2c54a7cc346cb044d08dc8ee5b6925 Mon Sep 17 00:00:00 2001 From: owl Date: Sat, 16 Sep 2023 11:55:31 +0200 Subject: config: make all message list symbols/icons configurable This patch removes the hard coded letters (which don't make sense in all languages), and replaces them with configurable icons, like the existing `icon-attachment` and other icons. Signed-off-by: owl Acked-by: Robin Jarry Reviewed-by: Bence Ferdinandy --- config/ui.go | 6 ++++++ doc/aerc-config.5.scd | 36 +++++++++++++++++++++++++++++++++++- lib/state/templates.go | 12 ++++++------ 3 files changed, 47 insertions(+), 7 deletions(-) diff --git a/config/ui.go b/config/ui.go index 699e8a0f..0479c13b 100644 --- a/config/ui.go +++ b/config/ui.go @@ -53,6 +53,12 @@ type UIConfig struct { IconUnknown string `ini:"icon-unknown" default:"[s?]"` IconInvalid string `ini:"icon-invalid" default:"[s!]"` IconAttachment string `ini:"icon-attachment" default:"a"` + IconReplied string `ini:"icon-replied" default:"r"` + IconNew string `ini:"icon-new" default:"N"` + IconOld string `ini:"icon-old" default:"O"` + IconFlagged string `ini:"icon-flagged" default:"!"` + IconMarked string `ini:"icon-marked" default:"*"` + IconDeleted string `ini:"icon-deleted" default:"D"` DirListDelay time.Duration `ini:"dirlist-delay" default:"200ms"` DirListTree bool `ini:"dirlist-tree"` DirListCollapse int `ini:"dirlist-collapse"` diff --git a/doc/aerc-config.5.scd b/doc/aerc-config.5.scd index 3f0b076a..50e7d803 100644 --- a/doc/aerc-config.5.scd +++ b/doc/aerc-config.5.scd @@ -345,10 +345,44 @@ These options are configured in the *[ui]* section of _aerc.conf_. Default: _[s!]_ *icon-attachment* = __ - The icon to display index-format when the message has an attachment. + The icon to display in *column-flags* when the message has an + attachment. Default: _a_ +*icon-new* = __ + The icon to display in *column-flags* when the message is unread and + new. + + Default: _N_ + +*icon-old* = __ + The icon to display in *column-flags* when the message is unread and + old. + + Default: _O_ + +*icon-replied* = __ + The icon to display in *column-flags* when the message has been replied + to. + + Default: _r_ + +*icon-flagged* = __ + The icon to display in *column-flags* when the message is flagged. + + Default: _!_ + +*icon-marked* = __ + The icon to display in *column-flags* when the message is marked. + + Default: _\*_ + +*icon-deleted* = __ + The icon to display in *column-flags* when the message has been deleted. + + Default: _D_ + *fuzzy-complete* = _true_|_false_ When typing a command or option, the popover will now show not only the items /starting/ with the string input by the user, but it will also show diff --git a/lib/state/templates.go b/lib/state/templates.go index 22d06589..fbe5aa4a 100644 --- a/lib/state/templates.go +++ b/lib/state/templates.go @@ -345,16 +345,16 @@ func (d *templateData) Flags() []string { switch { case d.info.Flags.Has(models.SeenFlag | models.AnsweredFlag): - flags = append(flags, "r") // message has been replied to + flags = append(flags, d.ui().IconReplied) // message has been replied to case d.info.Flags.Has(models.SeenFlag): break case d.info.Flags.Has(models.RecentFlag): - flags = append(flags, "N") // message is new + flags = append(flags, d.ui().IconNew) // message is unread and new default: - flags = append(flags, "O") // message is old + flags = append(flags, d.ui().IconOld) // message is unread and old } if d.info.Flags.Has(models.DeletedFlag) { - flags = append(flags, "D") + flags = append(flags, d.ui().IconDeleted) } if d.info.BodyStructure != nil { for _, bS := range d.info.BodyStructure.Parts { @@ -365,10 +365,10 @@ func (d *templateData) Flags() []string { } } if d.info.Flags.Has(models.FlaggedFlag) { - flags = append(flags, "!") + flags = append(flags, d.ui().IconFlagged) } if d.marked { - flags = append(flags, "*") + flags = append(flags, d.ui().IconMarked) } return flags } -- cgit v1.2.3-54-g00ecf