diff options
| author | Marco Martin <[email protected]> | 2022-10-04 15:54:11 +0200 |
|---|---|---|
| committer | Marco Martin <[email protected]> | 2022-10-08 07:02:00 +0000 |
| commit | 71ea4a88d890949500d05aa21839ad93ec6bdb1d (patch) | |
| tree | f8480c4623f54d313e5b4f162ce619e98705d31d /src | |
| parent | 84c4701bef5fe866069e1e6e33c06046b7c9385e (diff) | |
Replace context menu on long press with selection mode
on long touch (and not on mouse press) don't pop up the context menu
anymore but enter selection mode, similar behavior to mobile applications.
the full context menu is still available from the actions toolbar
appearing in selection mode
Diffstat (limited to 'src')
| -rw-r--r-- | src/kitemviews/kitemlistcontroller.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp index 7297f8aaa..955e418e8 100644 --- a/src/kitemviews/kitemlistcontroller.cpp +++ b/src/kitemviews/kitemlistcontroller.cpp @@ -1042,8 +1042,6 @@ void KItemListController::tapTriggered(QTapGesture* tap, const QTransform& trans m_pressedIndex = m_view->itemAt(m_pressedMousePos); if (m_dragActionOrRightClick) { - onPress(tap->hotSpot().toPoint(), tap->position().toPoint(), Qt::NoModifier, Qt::RightButton); - onRelease(transform.map(tap->position()), Qt::NoModifier, Qt::RightButton, false); m_dragActionOrRightClick = false; } else { @@ -1074,6 +1072,9 @@ void KItemListController::tapAndHoldTriggered(QGestureEvent* event, const QTrans if (m_pressedIndex.has_value() && !m_selectionManager->isSelected(m_pressedIndex.value())) { m_selectionManager->clearSelection(); m_selectionManager->setSelected(m_pressedIndex.value()); + if (!m_selectionMode) { + Q_EMIT selectionModeChangeRequested(true); + } } else if (!m_pressedIndex.has_value()) { m_selectionManager->clearSelection(); startRubberBand(); |
