aboutsummaryrefslogtreecommitdiffstats
path: root/src/cardlayout.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/cardlayout.h')
-rw-r--r--src/cardlayout.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/cardlayout.h b/src/cardlayout.h
index 1a2fd18..3512242 100644
--- a/src/cardlayout.h
+++ b/src/cardlayout.h
@@ -56,6 +56,18 @@ struct CardLayout
/// the geometry is exactly how a longer date gets elided into a rect
/// sized for a shorter one.
QString dateFormat;
+
+ /// Which marks line two carries (item 70).
+ ///
+ /// On the INPUT for the same reason dateFormat is: the marks were
+ /// glyphs inside the subject STRING until item 70, so their width came
+ /// free from the text metrics. Drawn as icons they occupy rects of
+ /// their own, and a subject sized as though they were absent would run
+ /// underneath them. The layout has to know they are there.
+ bool flagged = false;
+ bool hasAttachment = false;
+ bool passed = false;
+ bool replied = false;
};
/// Width of the account accent bar down a thread card's left edge.
@@ -94,6 +106,29 @@ struct CardLayout
/// Empty when the row has no replies.
QRect expanderRect;
+ /// The flagged mark, at the start of line two before the subject. Empty
+ /// when the row is not flagged.
+ QRect flagRect;
+
+ /// The state marks after the subject, in this order: attachment, passed,
+ /// replied. Each is empty when its state does not apply.
+ ///
+ /// Separate rects rather than one strip, because each is independently
+ /// present or absent and a strip would have to encode which. They are laid
+ /// out right to left from the expander, so the subject keeps whatever is
+ /// left.
+ QRect attachmentRect;
+ QRect passedRect;
+ QRect repliedRect;
+
+ /// The side of a square mark on line two, derived from the card's font so
+ /// the marks scale with the user's text size rather than being pinned to a
+ /// pixel count that is right on one desktop only.
+ static int markSide(const QFont &font);
+
+ /// Gap between two adjacent marks, and between a mark and the subject.
+ static constexpr int kMarkGap = 4;
+
/// The account accent bar down the card's left edge.
///
/// Thread cards only. A reply's account is its thread's, stated once at the