Ambareesh Balaji
2018-04-12 20:21:05 UTC
abalaji created this revision.
abalaji added a reviewer: Dolphin.
abalaji added a project: Dolphin.
abalaji requested review of this revision.
REVISION SUMMARY
This patch adds support for touch scrolling in Dolphin using QScroller. I'm using Qt::MouseEventNotSynthesized to figure out if a mouse event was synthesized (which means it was a touch event and not an actual mouse event). Rubberbands do not trigger during touch scrolling. To prevent accidental item activation during touch scrolling, I check if there was a mouseMoveEvent emitted in between a mousePressEvent and a mouseReleaseEvent, in which case I prevent item activation from happening. To deal with grabbing and dragging using the touchscreen, I've implemented a rudimentary "touch and hold" mechanism, with a QTimer that starts on a mousePress and waits for 1000 milliseconds to see if the mouse moved, and if that wasn't the case, it disables touch scrolling temporarily so that dragging takes over.
REPOSITORY
R318 Dolphin
REVISION DETAIL
https://phabricator.kde.org/D12162
AFFECTED FILES
src/kitemviews/kitemlistcontainer.cpp
src/kitemviews/kitemlistcontainer.h
src/kitemviews/kitemlistcontroller.cpp
src/kitemviews/kitemlistcontroller.h
To: abalaji, #dolphin
Cc: #dolphin, spoorun, navarromorales, isidorov, firef, andrebarros, emmanuelp
abalaji added a reviewer: Dolphin.
abalaji added a project: Dolphin.
abalaji requested review of this revision.
REVISION SUMMARY
This patch adds support for touch scrolling in Dolphin using QScroller. I'm using Qt::MouseEventNotSynthesized to figure out if a mouse event was synthesized (which means it was a touch event and not an actual mouse event). Rubberbands do not trigger during touch scrolling. To prevent accidental item activation during touch scrolling, I check if there was a mouseMoveEvent emitted in between a mousePressEvent and a mouseReleaseEvent, in which case I prevent item activation from happening. To deal with grabbing and dragging using the touchscreen, I've implemented a rudimentary "touch and hold" mechanism, with a QTimer that starts on a mousePress and waits for 1000 milliseconds to see if the mouse moved, and if that wasn't the case, it disables touch scrolling temporarily so that dragging takes over.
REPOSITORY
R318 Dolphin
REVISION DETAIL
https://phabricator.kde.org/D12162
AFFECTED FILES
src/kitemviews/kitemlistcontainer.cpp
src/kitemviews/kitemlistcontainer.h
src/kitemviews/kitemlistcontroller.cpp
src/kitemviews/kitemlistcontroller.h
To: abalaji, #dolphin
Cc: #dolphin, spoorun, navarromorales, isidorov, firef, andrebarros, emmanuelp