diff options
| author | Ahmad Samir <[email protected]> | 2020-10-01 18:21:18 +0200 |
|---|---|---|
| committer | Ahmad Samir <[email protected]> | 2020-10-04 19:41:40 +0000 |
| commit | aa12f9ec1d91b29de1305b8590f587b2cf9b56e3 (patch) | |
| tree | 3b4cbdd820113c838baec7c01c8c8bb76a1bc39c /src/kitemviews | |
| parent | 3d8bb6c385c4ed61faf930d9cfe74e20e573f6ce (diff) | |
Don't trigger rubberband with back/foward mouse buttons
Right now the back/foward mouse buttons work, but also if you hold either
of them and move the mouse the rubberband selection is triggered.
This is the correct fix (instead of commit d0c71a1435bc9d), to match the
original code before the touch events patches, we need to check the
back/foward buttons after mouseButtonPressed is emitted and before
triggering the rubberbad selection.
Diffstat (limited to 'src/kitemviews')
| -rw-r--r-- | src/kitemviews/kitemlistcontroller.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp index b7d1da7d2..60318047d 100644 --- a/src/kitemviews/kitemlistcontroller.cpp +++ b/src/kitemviews/kitemlistcontroller.cpp @@ -557,12 +557,6 @@ bool KItemListController::mousePressEvent(QGraphicsSceneMouseEvent* event, const return false; } - if (buttons & (Qt::BackButton | Qt::ForwardButton)) { - // Do not select items when clicking the back/forward buttons, see - // https://bugs.kde.org/show_bug.cgi?id=327412. - return true; - } - return true; } @@ -1423,6 +1417,12 @@ bool KItemListController::onPress(const QPoint& screenPos, const QPointF& pos, c { emit mouseButtonPressed(m_pressedIndex, buttons); + if (buttons & (Qt::BackButton | Qt::ForwardButton)) { + // Do not select items when clicking the back/forward buttons, see + // https://bugs.kde.org/show_bug.cgi?id=327412. + return true; + } + if (m_view->isAboveExpansionToggle(m_pressedIndex, m_pressedMousePos)) { m_selectionManager->endAnchoredSelection(); m_selectionManager->setCurrentItem(m_pressedIndex); |
