diff options
Diffstat (limited to 'src/threadlistview.h')
| -rw-r--r-- | src/threadlistview.h | 52 |
1 files changed, 16 insertions, 36 deletions
diff --git a/src/threadlistview.h b/src/threadlistview.h index 0ebe3ea..3215153 100644 --- a/src/threadlistview.h +++ b/src/threadlistview.h @@ -20,34 +20,19 @@ #include <QTreeView> -/// The thread list, with a row-wide strip of tag chips under each row's cells. +/// The thread list. /// -/// The strip is painted by the VIEW rather than by a delegate, and that is the -/// whole reason this class exists. A delegate is handed one cell's rectangle -/// and cannot paint outside its column, so pills drawn from the subject -/// column's delegate stop at that column's edge, losing the last tags of a -/// well-tagged thread, and start at that column's left edge, which puts them -/// under the subject instead of under the row. Painting after the cells lets -/// the strip run the full width, which is what the layout asks for: +/// It exists for ONE reason now: the expander is drawn by CardDelegate, and a +/// delegate gets no click of its own without an editor, so the view has to own +/// the hit-test. Everything else it used to do is gone. /// -/// [ date ][ from ][ subject ...................... ] -/// [ pill ][ pill ][ pill ] -/// -/// The cells confine themselves to the upper band so the lower one is free; -/// SubjectDelegate::kRowPadding and rowHeightFor() are the shared measurements -/// that keep the two halves agreeing. -/// -/// A QTreeView rather than a QTableView since item 20: a thread's replies are -/// child rows, and a table can neither indent nor expand. The strip survived -/// the port because every geometry call it needs (visualRect, -/// columnViewportPosition, indexAt, indexBelow) exists on both. What did NOT -/// survive is anything keyed on a row NUMBER: a tree numbers rows per parent, -/// so row 0 exists once per expanded thread and a flat 0..N walk paints the -/// first thread's strip over every one of them. The walk below goes by index. -/// -/// The strip is painted for THREAD rows only. It carries the thread's tags, so -/// one under each reply would stripe the list and repeat identical tags down -/// the whole expansion. +/// Until item 53 this class also painted a row-wide strip of tag chips after +/// the cells, because a delegate cannot paint outside its column and the strip +/// spanned all five. With one column and one delegate painting the whole card, +/// that reason is gone and so is the paintEvent, along with the two faults it +/// kept producing: a deleted row cut in half, and every other row showing a +/// bare stripe, both from the view having to re-honour alternating colours, +/// the selection and BackgroundRole across cells it did not own. class ThreadListView : public QTreeView { Q_OBJECT @@ -55,16 +40,11 @@ public: using QTreeView::QTreeView; protected: - void paintEvent(QPaintEvent *event) override; - - /// Toggles a thread when its expander glyph is clicked. + /// Toggles a thread when its reply count is clicked. /// - /// The view owns this because the glyph is drawn by SubjectDelegate and a - /// delegate gets no click of its own without an editor. Being VISIBLE and - /// being CLICKABLE are separate properties: setRootIsDecorated(false), - /// needed to stop the style drawing its own indicator underneath ours, also - /// removed the style's hit area, so the expander painted correctly and did - /// nothing at all. + /// Being VISIBLE and being CLICKABLE are separate properties: + /// setRootIsDecorated(false), needed to stop the style drawing its own + /// indicator underneath, also removed the style's hit area, so an expander + /// once painted correctly and did nothing at all. void mousePressEvent(QMouseEvent *event) override; - }; |
