summaryrefslogtreecommitdiffstats
path: root/src/carddelegate.h
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-10 09:50:48 +0200
committerDanilo M. <danix@danix.xyz>2026-08-10 09:50:48 +0200
commit1911887cb9d6a165a52412ed92014ff113d701c8 (patch)
tree3df77b7b20a265493d8e2fd1663a91a6a5408a76 /src/carddelegate.h
parent8031901652758e9db5ef0bb545c062f80f2f8cc2 (diff)
downloadqtmaildir-1911887cb9d6a165a52412ed92014ff113d701c8.tar.gz
qtmaildir-1911887cb9d6a165a52412ed92014ff113d701c8.zip
feat(view): lift a muted account colour for the accent bar
The five real account colours are all mid-tone, because they were chosen as CHIP fills with legible text on top, and three pixels of a mid-tone colour barely registers beside a card's own background. The bar now lifts saturation and lightness to a floor. A floor, not a repaint: a colour already past it is returned untouched, so a deliberately vivid choice is preserved and only the muted ones move. Hue is never altered, because hue is the entire information the bar carries and a shifted one would stop matching the account's chip and its dropdown swatch. 0.65 and 0.50 were chosen by rendering all five accounts as 3px bars against both a dark and a light card background and looking at them. Higher pushed the weakest of them, a green at S 0.33, toward a neon that no longer matched its own chip; lower left it where it started. accentLineColour had no test at all until now, which is how two earlier versions of it shipped wrong: one blended toward Base until it WAS the background, the other passed a chip colour through unchanged. test_carddelegate covers the lift, the floor's idempotence, hue preservation across all five accounts, and the fallback for a thread with no account tag.
Diffstat (limited to 'src/carddelegate.h')
-rw-r--r--src/carddelegate.h31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/carddelegate.h b/src/carddelegate.h
index 7012eaa..74dee8e 100644
--- a/src/carddelegate.h
+++ b/src/carddelegate.h
@@ -52,20 +52,27 @@ public:
static QRect expanderRectFor(const QStyleOptionViewItem &option,
const QModelIndex &index);
- /// The colour the accent bar is painted in: the account's own, undiluted.
+ /// The colour the accent bar is painted in: the account's hue, lifted to a
+ /// floor of saturation and lightness.
///
- /// Blending it toward the palette's Base was tried first, at the 0.35
- /// weight threadLineColour() uses, and produced an INVISIBLE bar on a dark
- /// theme: against a Base of (0.169, 0.169, 0.169) it landed at (0.18, 0.22,
- /// 0.26), which is the background. The weight is a fraction OF THE ACCOUNT
- /// COLOUR, so a low one keeps the background rather than the hue.
+ /// Two earlier versions were wrong in opposite directions. Blending toward
+ /// the palette's Base at threadLineColour()'s 0.35 weight produced an
+ /// INVISIBLE bar on a dark theme, landing at (0.18, 0.22, 0.26) against a
+ /// Base of (0.169, 0.169, 0.169): the weight is a fraction OF THE ACCOUNT
+ /// COLOUR, so a low one keeps the background rather than the hue. Passing
+ /// the raw colour through fixed that and was still too quiet, because an
+ /// account colour is chosen as a CHIP's fill with legible text on top and
+ /// is therefore mid-tone by construction.
///
- /// An account colour is already chosen to be a chip's fill with legible
- /// text on top, so it is muted to begin with; three pixels of a muted
- /// colour is nothing. Nothing is drawn on this bar, so it needs none of the
- /// contrast that choice was made for. The SPINE is where the muting belongs
- /// and is blended in paint(): it runs the full height of every reply in an
- /// expansion and has to be followable without competing with the senders.
+ /// A floor, not a repaint: a colour already past it is returned untouched,
+ /// so a deliberately vivid choice is preserved. Hue is never altered, since
+ /// hue is the whole information the bar carries and a shifted one would
+ /// stop matching the account's chip and its swatch in the dropdown.
+ ///
+ /// The SPINE takes its colour from this and mutes it again in paint(): it
+ /// runs the full height of every reply in an expansion and has to be
+ /// followable without competing with the senders, which is a different
+ /// problem from a 3px edge marker.
///
/// Falls back to threadLineColour() for a thread with no account tag.
static QColor accentLineColour(const QColor &accountColour);