diff options
| author | Danilo M. <danix@danix.xyz> | 2026-08-26 15:58:40 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-08-26 15:58:40 +0200 |
| commit | ef4d48c56c39f19efc751488cc2df6ee5af24a7f (patch) | |
| tree | 0a7fd1fd7dc1df9a2842a61d8416586698de7bfd /src/carddelegate.h | |
| parent | ca5b6ca711e73bc22fdf108e06d82241e059c6ee (diff) | |
| download | qtmaildir-ef4d48c56c39f19efc751488cc2df6ee5af24a7f.tar.gz qtmaildir-ef4d48c56c39f19efc751488cc2df6ee5af24a7f.zip | |
feat: fade the account colour across a card
Diffstat (limited to 'src/carddelegate.h')
| -rw-r--r-- | src/carddelegate.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/carddelegate.h b/src/carddelegate.h index 1846359..5a0830c 100644 --- a/src/carddelegate.h +++ b/src/carddelegate.h @@ -77,6 +77,21 @@ public: /// Falls back to threadLineColour() for a thread with no account tag. static QColor accentLineColour(const QColor &accountColour); + /// 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. + /// + /// 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. + static constexpr qreal kFadeFraction = 0.60; + /// A tag chip's colour, drained for the SIBLING tier (item 111). /// /// Saturation only: hue stays so the tag is still recognisable, and |
