mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-28 03:21:56 +00:00
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
This commit is contained in:
parent
84c4701bef
commit
71ea4a88d8
|
@ -1042,8 +1042,6 @@ void KItemListController::tapTriggered(QTapGesture* tap, const QTransform& trans
|
||||||
m_pressedIndex = m_view->itemAt(m_pressedMousePos);
|
m_pressedIndex = m_view->itemAt(m_pressedMousePos);
|
||||||
|
|
||||||
if (m_dragActionOrRightClick) {
|
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;
|
m_dragActionOrRightClick = false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -1074,6 +1072,9 @@ void KItemListController::tapAndHoldTriggered(QGestureEvent* event, const QTrans
|
||||||
if (m_pressedIndex.has_value() && !m_selectionManager->isSelected(m_pressedIndex.value())) {
|
if (m_pressedIndex.has_value() && !m_selectionManager->isSelected(m_pressedIndex.value())) {
|
||||||
m_selectionManager->clearSelection();
|
m_selectionManager->clearSelection();
|
||||||
m_selectionManager->setSelected(m_pressedIndex.value());
|
m_selectionManager->setSelected(m_pressedIndex.value());
|
||||||
|
if (!m_selectionMode) {
|
||||||
|
Q_EMIT selectionModeChangeRequested(true);
|
||||||
|
}
|
||||||
} else if (!m_pressedIndex.has_value()) {
|
} else if (!m_pressedIndex.has_value()) {
|
||||||
m_selectionManager->clearSelection();
|
m_selectionManager->clearSelection();
|
||||||
startRubberBand();
|
startRubberBand();
|
||||||
|
|
Loading…
Reference in a new issue