Bundle cursor wrapping algorithms from PageView and ThumbnailListPrivate
This bundles mouse cursor wrapping algorithms from PageView::... and ThumbnailListPrivate::mouseMoveEvent() GuiUtils::CursorWrapHelper. This simplifies the code in PageView::mouseMoveEvent(), which is basically concerned about more important stuff than cursor wrapping.
GuiUtils::CursorWrapHelper::wrapCursor() returns only whether the cursor was moved. This is intended, because Qt can not guarantee how much or whether at all the cursor is repositioned.
As far as I could test it, it also works on translated hiDPI screens.
Suggested commit message
Unify cursor wrapping code in ThumbnailList and PageView
Create a new class GuiUtils::CursorWrapHelper, which bundles
mouse cursor wrapping algorithms from PageView and ThumbnailListPrivate::mouseMoveEvent()
in a class.
PageView::mouseMoveEvent() now only calls GuiUtils::CursorWrapHelper::wrapCursor(),
which simplifies the remaining code.
Edited by Laura David Hurka