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/mainwindow.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 19373e3..e93898c 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -962,8 +962,13 @@ void MainWindow::buildUi() // the viewport and auto-scroll brought the clicked index fully into view. m_threadView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - // Scrolling a whole card at a time rather than a fraction of one, so a - // card is never left half above the top edge. + // Per PIXEL, so a touchpad moves the list continuously. Qt's default is + // per ITEM, which jumped several whole cards per wheel notch and quantised + // a touchpad's small deltas into card-sized jumps, so the eye lost track + // of how far the list had moved. The cost is that a card can rest half + // above the top edge. A wheel notch glides one step, which is one card; + // see ThreadListView::wheelEvent. + m_threadView->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); m_threadView->verticalScrollBar()->setSingleStep( CardLayout::heightFor(m_threadView->font())); -- cgit v1.2.3