aboutsummaryrefslogtreecommitdiffstats
path: root/src/carddelegate.h
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-26 17:50:18 +0200
committerDanilo M. <danix@danix.xyz>2026-08-26 17:50:18 +0200
commit9ae43f94f5d822efe582e79b47b2f5407161a38b (patch)
treed9b956fb6bb0034da6ca8c923017235b89bb5926 /src/carddelegate.h
parent8dec28ff4f1176b485d9de722756c677be3a4f1c (diff)
downloadqtmaildir-9ae43f94f5d822efe582e79b47b2f5407161a38b.tar.gz
qtmaildir-9ae43f94f5d822efe582e79b47b2f5407161a38b.zip
fix: correct the avatar initials, the two-tone fill and the fade
Hand-testing item 169 found four defects, three of them visible on every card. The initials were taken from whatever the card's first line held, which is the raw From header on a reply row and notmuch's comma-joined author summary on a thread row. A naive space split therefore gave `T<` for `tsujan <notifications@github.com>` and one letter each from two different people for `Standreas, tsujan`, and a separator counted as a word, so `INE - Expert IT Training` drew `I-`. Avatar::initialsFor() now normalises first: the angle-addr and any quoting go, a comma takes the first entry unless the name is quoted, a bare address is not a name, and a word has to carry a letter or a digit. Avatar::fillFor() uses the same normalisation, so an address in the name's place no longer reads as a person. The two-tone fill built its gradient axis as a radius from the centre, so the 0.5 colour stop landed on the squircle's edge and one hue filled almost the whole face. The axis spans the diameter now. The fade ran left to right, which put its hard stop at 60% of the card and read as a slab rather than a wash. It runs right to left: opaque at the card's right edge, where the only hard stop is the card's own boundary, and gone before it reaches the accent bar that already states the account. And the flat views hashed the user's own address on every row, so every Sent and Drafts card shared one pattern. ThreadSummary::firstMessageRecipient rides the recipient fold, which already parses the To header, and SenderAddressRole prefers it, falling back to the sender when there is no usable To. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P88Q3MCSCSQxKDy7pmXh9F
Diffstat (limited to 'src/carddelegate.h')
-rw-r--r--src/carddelegate.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/carddelegate.h b/src/carddelegate.h
index 18c735f..cfbd23e 100644
--- a/src/carddelegate.h
+++ b/src/carddelegate.h
@@ -81,16 +81,18 @@ public:
/// Where the account's fade runs, given the card and the row's innermost
/// spine (an empty rect for a thread root, which has none).
///
- /// A root's fade starts at the card's left edge; a reply's starts at its
- /// own spine, which IS its coloured left border, so the wash steps right
- /// with the nesting. Both end at 60% of the card's width, so a deeper
- /// reply's wash is shorter as well as further right.
+ /// Runs RIGHT to left: opaque at the card's right edge and gone 60% of the
+ /// width in, so the only hard stop is the card's own boundary and the
+ /// accent bar is left to state the account on its own. A reply is clamped
+ /// at its own spine, which IS its coloured left border, so its wash is
+ /// shorter as well as further right.
///
/// Static and rect-in, rect-out so the geometry is assertable without a
/// painter, for the same reason CardLayout is.
static QRect fadeRectFor(const QRect &card, const QRect &innermostSpine);
- /// How far across the card the account's colour reaches.
+ /// How far back across the card, from its right edge, the account's
+ /// colour reaches.
static constexpr qreal kFadeFraction = 0.60;
/// A tag chip's colour, drained for the SIBLING tier (item 111).