Enforce hardcoded singleStep/pageStep of 100/500 on message list view
ClosedPublic

Authored by mwolff on Mar 3 2020, 8:41 AM.

Details

Summary

This way, we get a more fluid scrolling behavior. Previously, the
two values got set somewhat randomly - I couldn't figure out the
logic behind it. Most notably, both values where set to very large
values, sometimes in excess of 1000, which lead to the jumpy scrolling
behavior previously.

Diff Detail

Repository
R865 Ruqola
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mwolff requested review of this revision.Mar 3 2020, 8:41 AM
mwolff created this revision.
dfaure requested changes to this revision.Mar 3 2020, 9:25 AM
dfaure added inline comments.
src/widgets/room/messagelistview.cpp
60

Still feels jumpy to me.

verticalScrollBar()->setSingleStep(fontMetrics().height() + 10);

works nicely here (both Key_Up and mousewheel), and has the benefit of looking less hardcoded (the 10 is an approx of the margins used by the delegate, 8+3 iirc)

This revision now requires changes to proceed.Mar 3 2020, 9:25 AM
mwolff updated this revision to Diff 76880.Mar 3 2020, 7:48 PM

use font metrics

dfaure accepted this revision.Mar 3 2020, 11:06 PM
dfaure added inline comments.
src/widgets/room/messagelistview.cpp
61

I'm wondering if this should be set to the viewport height? That is the "page", visually...

This revision is now accepted and ready to land.Mar 3 2020, 11:06 PM
mwolff added inline comments.Mar 4 2020, 8:49 AM
src/widgets/room/messagelistview.cpp
61

good idea, though imo it should be half a page, or 3/4 of a page to not lose context. kate also doesn't scroll the full page while scrolling

dfaure added inline comments.Mar 4 2020, 9:33 AM
src/widgets/room/messagelistview.cpp
61

OK, I'm happy if we do something similar to what kate does indeed.

This revision was automatically updated to reflect the committed changes.
mwolff added a comment.Mar 5 2020, 8:33 PM

git fail, accidentally pushed this too early - will implement the page fix on top now and push it directly

mwolff added a comment.Mar 5 2020, 8:57 PM

done, please test :)

dfaure added a comment.Mar 8 2020, 9:10 AM

Works great, thanks!