diff options
| author | Danilo M. <danix@danix.xyz> | 2026-08-10 09:33:44 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-08-10 09:33:44 +0200 |
| commit | 01419de209c2b5e2ae7b996e6b5ff1baa2efb3da (patch) | |
| tree | 25718fd36e87eac721f41b02cca46b6fb07e94d9 /src/tagchip.h | |
| parent | f72dba9f6c463c6823d85701e51d8be38dd22a62 (diff) | |
| parent | e1dba2987a9a1e87b92801959df9c9d4f1375d2f (diff) | |
| download | qtmaildir-01419de209c2b5e2ae7b996e6b5ff1baa2efb3da.tar.gz qtmaildir-01419de209c2b5e2ae7b996e6b5ff1baa2efb3da.zip | |
Merge branch 'card-list': the thread pane as a list of cards
Replaces the five-column grid with a single column of three-line cards. Item 53
recorded that the columns, not the cues drawn inside them, were what made the
list read as a table of records; item 20 had already shipped finished, tested
and green and been rejected on sight for exactly that reason.
A card is sender and date, subject with the flag, attachment and reply-count
marks, and tags, at one uniform height. Replies indent under a continuous spine
and show only the tags their thread does not carry. The account colour runs down
the card's left edge, replacing the chip that used to eat a third of every
subject line, with matching swatches in the account dropdown. Sorting newest or
oldest first is new and remembered.
Closes items 20, 51, 53 and 60.
The four defects that mattered were all found by rendering cards to an image and
looking at them, with the suite green through every one: a date clipped on unread
cards because bold is wider than the font the layout measured, an accent bar
painted in a colour identical to the background, an expander pill in a palette
role a theme had made equal to Base, and three separate faults from trusting
notmuch's reply depth to mean structure when it only means how notmuch happened
to thread the mail.
Diffstat (limited to 'src/tagchip.h')
| -rw-r--r-- | src/tagchip.h | 42 |
1 files changed, 2 insertions, 40 deletions
diff --git a/src/tagchip.h b/src/tagchip.h index cc3b5de..5514cae 100644 --- a/src/tagchip.h +++ b/src/tagchip.h @@ -59,8 +59,8 @@ void paint(QPainter *painter, const QRect &rect, const QString &text, /// the selection highlight it lands as grey on the highlight colour, close to /// unreadable. /// -/// Applied to the columns that have no delegate of their own; SubjectDelegate -/// inherits it for the subject column. +/// Inherited by CardDelegate, which is the only delegate the thread list +/// installs. class RowStyleDelegate : public QStyledItemDelegate { Q_OBJECT @@ -72,41 +72,3 @@ protected: const QModelIndex &index) const override; }; -/// Item delegate for the subject column: draws the account chip in front of -/// the subject text, so which mailbox a thread came from reads at a glance -/// without a tags column spelling it out. -/// **Install on the subject column only.** It reads AccountLabelRole, which is -/// a property of the row rather than of a cell, so as a view-wide delegate it -/// draws the account chip into every column. -class SubjectDelegate : public RowStyleDelegate -{ - Q_OBJECT -public: - using RowStyleDelegate::RowStyleDelegate; - - void paint(QPainter *painter, const QStyleOptionViewItem &option, - const QModelIndex &index) const override; - QSize sizeHint(const QStyleOptionViewItem &option, - const QModelIndex &index) const override; - - /// Vertical breathing room above the subject and below the pill row. - static constexpr int kRowPadding = 4; - - /// The font the pill strip is drawn in: a size down from the row's own. - /// - /// At the same size the pills read as a second row of content competing - /// with the subject, rather than as annotation beneath it. Derived from - /// the row font rather than fixed, so it follows the desktop's font size. - static QFont pillFont(const QFont &rowFont); - - /// The height every row gets, tall enough for the subject and a pill strip - /// beneath it. The view applies this itself: a QTableView takes one height - /// for the whole row, so leaving it to a single column's sizeHint would - /// let whichever column the view happens to ask decide. - static int rowHeightFor(const QFont &rowFont); - -protected: - /// The height of the band the subject text occupies. Everything below it - /// belongs to ThreadListView's row-wide pill strip. - static int subjectBandHeight(const QStyleOptionViewItem &option); -}; |
