aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorowl <owl@u8.is>2023-09-16 11:55:31 +0200
committerRobin Jarry <robin@jarry.cc>2023-09-19 11:23:40 +0200
commit43df87552c2c54a7cc346cb044d08dc8ee5b6925 (patch)
treed4cb4524ce16db99318275203e52ee740cda5bf3
parent4400b08a95b4f4548388e34858516df33d80b2d3 (diff)
downloadaerc-43df87552c2c54a7cc346cb044d08dc8ee5b6925.tar.gz
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 <owl@u8.is> Acked-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
-rw-r--r--config/ui.go6
-rw-r--r--doc/aerc-config.5.scd36
-rw-r--r--lib/state/templates.go12
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* = _<string>_
- 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* = _<string>_
+ The icon to display in *column-flags* when the message is unread and
+ new.
+
+ Default: _N_
+
+*icon-old* = _<string>_
+ The icon to display in *column-flags* when the message is unread and
+ old.
+
+ Default: _O_
+
+*icon-replied* = _<string>_
+ The icon to display in *column-flags* when the message has been replied
+ to.
+
+ Default: _r_
+
+*icon-flagged* = _<string>_
+ The icon to display in *column-flags* when the message is flagged.
+
+ Default: _!_
+
+*icon-marked* = _<string>_
+ The icon to display in *column-flags* when the message is marked.
+
+ Default: _\*_
+
+*icon-deleted* = _<string>_
+ 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
}