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 /tests | |
| parent | ca5b6ca711e73bc22fdf108e06d82241e059c6ee (diff) | |
| download | qtmaildir-ef4d48c56c39f19efc751488cc2df6ee5af24a7f.tar.gz qtmaildir-ef4d48c56c39f19efc751488cc2df6ee5af24a7f.zip | |
feat: fade the account colour across a card
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_carddelegate.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/test_carddelegate.cpp b/tests/test_carddelegate.cpp index a14671d..6ec43b8 100644 --- a/tests/test_carddelegate.cpp +++ b/tests/test_carddelegate.cpp @@ -36,6 +36,8 @@ private slots: void aSiblingChipIsMutedButStaysLegibleAndRecognisable(); void aSiblingChipFontIsSmallerThanItsOwnTier(); void aSiblingChipsPaddingShrinksWithItsFont(); + void theFadeEndsAtSixtyPercentOfTheCard(); + void aReplyFadeStartsAtItsOwnSpine(); }; namespace { @@ -259,5 +261,28 @@ void TestCardDelegate::aSiblingChipsPaddingShrinksWithItsFont() "on the chip's rounded end"); } +void TestCardDelegate::theFadeEndsAtSixtyPercentOfTheCard() +{ + const QRect card(0, 0, 500, 60); + const QRect root = CardDelegate::fadeRectFor(card, QRect()); + QCOMPARE(root.left(), card.left()); + QCOMPARE(root.width(), 300); +} + +void TestCardDelegate::aReplyFadeStartsAtItsOwnSpine() +{ + const QRect card(0, 0, 500, 60); + // The innermost spine of a nested reply, which is its own coloured border. + const QRect spine(80, 0, 2, 60); + const QRect reply = CardDelegate::fadeRectFor(card, spine); + + // It hangs off the spine, not off the card's edge. + QCOMPARE(reply.left(), spine.left()); + // And still ends at 60% of the CARD, so a deeper reply's wash is shorter + // as well as further right. + QCOMPARE(reply.right(), CardDelegate::fadeRectFor(card, QRect()).right()); + QVERIFY(reply.width() < CardDelegate::fadeRectFor(card, QRect()).width()); +} + QTEST_MAIN(TestCardDelegate) #include "test_carddelegate.moc" |
