1
0
mirror of https://invent.kde.org/system/dolphin synced 2024-07-07 10:51:45 +00:00

Enter selection mode by tap-and-holding an already selected item

Allow entering selection mode by touching an already selected item.

BUG: 462778
This commit is contained in:
Steffen Hartleib 2023-08-01 10:10:28 +00:00 committed by Felix Ernst
parent 567f2858ac
commit 89dcef3af4

View File

@ -1095,13 +1095,15 @@ void KItemListController::tapAndHoldTriggered(QGestureEvent *event, const QTrans
}
const QPointF pressedMousePos = transform.map(event->mapToGraphicsScene(tap->position()));
m_pressedIndex = m_view->itemAt(pressedMousePos);
if (m_pressedIndex.has_value() && !m_selectionManager->isSelected(m_pressedIndex.value())) {
m_selectionManager->clearSelection();
m_selectionManager->setSelected(m_pressedIndex.value());
if (m_pressedIndex.has_value()) {
if (!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()) {
} else {
m_selectionManager->clearSelection();
startRubberBand();
}