From db7bbb81f02b52c2a1b299fe140abffab7e74642 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 3 Aug 2026 15:41:33 +0200 Subject: feat: let an account set its chip colour and label Two optional keys in an [account.] stanza. color fills the chip, label sets its text. Both belong to the account rather than to [tagcolors] because an account tag is a different taxonomy: which mailbox a thread arrived in, not what state it is in. label is display only. "account-privateemail-danilo.macri" is a lot of row for one bit of information, but the notmuch tag is never renamed, so existing queries and external tagging are unaffected. Unset falls back to the account key, and an empty label is ignored rather than rendering a blank chip. --- src/config.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/config.h') diff --git a/src/config.h b/src/config.h index 270b780..943cbd8 100644 --- a/src/config.h +++ b/src/config.h @@ -18,6 +18,7 @@ #pragma once +#include #include #include #include @@ -33,6 +34,15 @@ struct Account QString maildir; ///< Relative to notmuch's database.path. QString drafts; ///< Unused in v1; send is v2. + /// Chip colour in the thread list. Invalid when unset, in which case one + /// is generated from the account tag's name. + QColor color; + + /// Text shown on the chip. Empty falls back to the key, which can be long: + /// "privateemail-danilo.macri" is a lot of row for one bit of information. + /// This renames nothing in notmuch, only what the chip displays. + QString label; + bool isValid() const { return !key.isEmpty() && !maildir.isEmpty(); } /// Restricts a notmuch query to this account's subtree. -- cgit v1.2.3