aboutsummaryrefslogtreecommitdiffstats
path: root/src/cardlayout.h
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-28 20:46:44 +0200
committerDanilo M. <danix@danix.xyz>2026-08-28 20:46:44 +0200
commitd7c4d03f7d583767bc23406579e11bcc884dec18 (patch)
treeabe49fa75cb88d768a892cc11a8c2258869ead85 /src/cardlayout.h
parentae2ae2df75ed780a88423b77af3b31fbe2b26389 (diff)
downloadqtmaildir-d7c4d03f7d583767bc23406579e11bcc884dec18.tar.gz
qtmaildir-d7c4d03f7d583767bc23406579e11bcc884dec18.zip
feat: count a card's messages, not its repliesthread-row-identity
The expander pill read "N replies" while the row stood for the conversation: a thread of one message and four replies said "4 replies" over rows that listed all five messages. The user's model is messages, so it now reads "5 messages". A thread of one still shows nothing: its row is the message, the pill is the expander, and there is nothing to open. ReplyCountRole becomes MessageCountRole and CardLayout::Input::replyCount becomes messageCount, so the names stop lying about what they carry. The label is now translated under a CardLayout context, with Italian "messaggio"/"messaggi" shipped; %n's untranslated fallback on this Qt does not pluralise, so the two forms are separate entries. The card's densest geometry test needs 460px rather than 400 now that the pill is one character wider.
Diffstat (limited to 'src/cardlayout.h')
-rw-r--r--src/cardlayout.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/cardlayout.h b/src/cardlayout.h
index 57edca7..9620900 100644
--- a/src/cardlayout.h
+++ b/src/cardlayout.h
@@ -35,7 +35,7 @@
/// The card is three lines, always:
///
/// sender ................................ date <- senderRect/dateRect
-/// * subject @ v 3 replies <- subjectRect/expanderRect
+/// * subject @ v 5 messages <- subjectRect/expanderRect
/// [tag] [tag] <- tagRect
struct CardLayout
{
@@ -45,7 +45,7 @@ struct CardLayout
{
bool isMessage = false;
int depth = 0; ///< 0 for a thread root, 1 for a direct reply.
- int replyCount = 0; ///< 0 means no expander.
+ int messageCount = 0; ///< Messages in the conversation; 0 means no expander.
/// A QDateTime::toString() pattern from [general] date_format, or empty
/// for the system's short format.
@@ -105,8 +105,8 @@ struct CardLayout
QRect subjectRect;
QRect tagRect;
- /// The reply count's rect, and the click target that toggles the thread.
- /// Empty when the row has no replies.
+ /// The message count's rect, and the click target that toggles the thread.
+ /// Empty when the row has no expander.
QRect expanderRect;
/// The flagged mark, at the start of line two before the subject. Empty
@@ -197,15 +197,18 @@ struct CardLayout
/// The widest string formatDate() can return, for reserving space.
static QString widestDateSample(const QString &format = QString());
- /// The expander's label: the reply count with its glyph, as drawn.
+ /// The expander's label: the message count with its word, as drawn.
///
/// Shared with the layout for the same reason as formatDate: the rect
/// reserved for the pill and the text put inside it must come from one
/// place, or a count wider than the sample the layout guessed at spills
/// out of its own background.
///
- /// `expanded` chooses which way the triangle points.
- static QString expanderLabel(int replyCount, bool expanded);
+ /// `expanded` chooses which way the triangle points. The word is
+ /// translated: a pill reading a foreign count in English next to an
+ /// otherwise local interface is a tiny broken window, and this is the one
+ /// user-facing string this plain struct owns.
+ static QString expanderLabel(int messageCount, bool expanded);
/// Padding inside the expander pill, matching a tag chip's, so the two read
/// as the same kind of object on the card.