From 9ae9473acdb7cb3310c3028765cc4b30fedfce27 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Thu, 1 Oct 2026 10:49:18 +0200 Subject: feat: scroll the thread list smoothly The list scrolled per ITEM, Qt's default, so a wheel notch jumped several whole cards at once and a touchpad's small deltas were quantised into card-sized jumps. The eye lost track of how far the list had moved. The view now scrolls per pixel, so a touchpad moves it continuously, and ThreadListView::wheelEvent turns each wheel notch into a 160ms eased glide of exactly one card. Notches arriving mid-glide add to its target rather than restarting from where it has got to. Pixel deltas and modified wheels pass through to Qt unchanged. The cost of per-pixel scrolling is that a card can rest half above the top edge. Co-Authored-By: Claude Opus 5.5 --- src/threadlistview.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/threadlistview.h') diff --git a/src/threadlistview.h b/src/threadlistview.h index a509389..79db424 100644 --- a/src/threadlistview.h +++ b/src/threadlistview.h @@ -20,6 +20,8 @@ #include +class QPropertyAnimation; + /// The thread list. /// /// It exists for ONE reason now: the expander is drawn by CardDelegate, and a @@ -47,4 +49,15 @@ protected: /// 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; + + /// A mouse wheel notch GLIDES one scrollbar step instead of jumping, so + /// the eye can follow how far the list moved. Notches arriving mid-glide + /// add to its target rather than restarting from where it has got to. A + /// touchpad's pixel deltas are already continuous and pass straight + /// through, as does any wheel with a modifier held. + void wheelEvent(QWheelEvent *event) override; + +private: + /// Created on the first notch, owned by the view. + QPropertyAnimation *m_glide = nullptr; }; -- cgit v1.2.3