diff options
| author | Danilo M. <danix@danix.xyz> | 2026-08-26 15:50:33 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-08-26 15:50:33 +0200 |
| commit | 5e769b073062a8913d2c4250d079aeb2d7d7b0e8 (patch) | |
| tree | 4b2078bebb96ba2b2f6c0270aecb04dd2c1233f0 /src/cardlayout.cpp | |
| parent | c3cfd28844c34aa7f7b390215f73d0b56534bdd0 (diff) | |
| download | qtmaildir-5e769b073062a8913d2c4250d079aeb2d7d7b0e8.tar.gz qtmaildir-5e769b073062a8913d2c4250d079aeb2d7d7b0e8.zip | |
feat: reserve a card's avatar gutter
Diffstat (limited to 'src/cardlayout.cpp')
| -rw-r--r-- | src/cardlayout.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/cardlayout.cpp b/src/cardlayout.cpp index d32935b..a9bbe52 100644 --- a/src/cardlayout.cpp +++ b/src/cardlayout.cpp @@ -175,6 +175,16 @@ CardLayout CardLayout::compute(const Input &input, const QRect &rect, const int indent = depth * kIndentStep; out.contentLeft = textLeft + kPaddingX + indent; + // The avatar, square, in the gutter between the indent and the text. + // Sized from the card's HEIGHT rather than from a pixel constant, so it + // follows the desktop's font exactly as markSide() does. + const int avatarSide = qMax(0, rect.height() - kPaddingY * 2); + out.avatarRect = QRect(out.contentLeft, rect.top() + kPaddingY, + avatarSide, avatarSide); + // Everything after it starts past the squircle. This is what the item's + // cost is: a deep reply loses the gutter on top of its indent. + out.contentLeft = out.avatarRect.right() + 1 + kAvatarGap; + // One spine per level actually indented, each running the card's full // height so an expansion reads as one continuous block. for (int level = 0; level < depth; ++level) { |
