From 91b26ad93f93743f3222515755d688e5864d61bd Mon Sep 17 00:00:00 2001 From: Bence Ferdinandy Date: Wed, 22 Nov 2023 11:54:22 +0100 Subject: ui: make viewer tab title configurable via templates We had account and composer tab title configuration fields already, but not for viewer. Add tab-title-viewer configuration, which defaults to Subject if it is not empty and to "(no subject)" when it is empty. Changelog-added: New `[ui].tab-title-viewer` setting to configure the message viewer tab title. Changelog-changed: Message viewer tab titles will now show `(no subject)` if there is no subject in the viewed email. Signed-off-by: Bence Ferdinandy Acked-by: Robin Jarry --- config/ui.go | 1 + 1 file changed, 1 insertion(+) (limited to 'config/ui.go') diff --git a/config/ui.go b/config/ui.go index 17f2339f..5539d288 100644 --- a/config/ui.go +++ b/config/ui.go @@ -83,6 +83,7 @@ type UIConfig struct { // Tab Templates TabTitleAccount *template.Template `ini:"tab-title-account" default:"{{.Account}}"` TabTitleComposer *template.Template `ini:"tab-title-composer" default:"{{.Subject}}"` + TabTitleViewer *template.Template `ini:"tab-title-viewer" default:"{{if .Subject}}{{.Subject}}{{else}}(no subject){{end}}"` // private contextualUis []*UiConfigContext -- cgit