aboutsummaryrefslogtreecommitdiffstats
path: root/src/carddelegate.h
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-26 16:03:49 +0200
committerDanilo M. <danix@danix.xyz>2026-08-26 16:03:49 +0200
commitbd90331cba3633754482fc13b99ae39a3b5f79a2 (patch)
treed850c76f382aa94db5139edceb72c18bc08851ec /src/carddelegate.h
parentef4d48c56c39f19efc751488cc2df6ee5af24a7f (diff)
downloadqtmaildir-bd90331cba3633754482fc13b99ae39a3b5f79a2.tar.gz
qtmaildir-bd90331cba3633754482fc13b99ae39a3b5f79a2.zip
feat: draw a sender's avatar on every card
Diffstat (limited to 'src/carddelegate.h')
-rw-r--r--src/carddelegate.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/carddelegate.h b/src/carddelegate.h
index 5a0830c..18c735f 100644
--- a/src/carddelegate.h
+++ b/src/carddelegate.h
@@ -18,6 +18,7 @@
#pragma once
+#include "businesssenders.h"
#include "tagchip.h"
/// Paints a whole card: three lines, all of it, including the tag chips.
@@ -109,4 +110,31 @@ public:
/// survived exactly that kind of test.
static QSize chipSize(const QFontMetrics &metrics, const QString &text,
bool own);
+
+ /// The squircle for one row, resolved from what the model supplies.
+ ///
+ /// Falls back to the ACCOUNT when the row has no sender address, so every
+ /// card carries an avatar rather than a hole: the seed becomes the
+ /// account's own address and the letters come from its label.
+ static QPixmap avatarFor(const QString &senderAddress,
+ const QString &senderName,
+ const QString &accountAddress,
+ const QString &accountLabel,
+ bool isBusinessSender, int side,
+ const QFont &font);
+
+ void setAccountAddress(const QString &address)
+ {
+ m_accountAddress = address;
+ }
+ void setAccountLabel(const QString &label) { m_accountLabel = label; }
+ void setBusinessSenders(const BusinessSenders::List &list)
+ {
+ m_businessSenders = list;
+ }
+
+private:
+ QString m_accountAddress;
+ QString m_accountLabel;
+ BusinessSenders::List m_businessSenders;
};