mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-28 03:21:56 +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:
parent
567f2858ac
commit
89dcef3af4
|
@ -1095,13 +1095,15 @@ void KItemListController::tapAndHoldTriggered(QGestureEvent *event, const QTrans
|
||||||
}
|
}
|
||||||
const QPointF pressedMousePos = transform.map(event->mapToGraphicsScene(tap->position()));
|
const QPointF pressedMousePos = transform.map(event->mapToGraphicsScene(tap->position()));
|
||||||
m_pressedIndex = m_view->itemAt(pressedMousePos);
|
m_pressedIndex = m_view->itemAt(pressedMousePos);
|
||||||
if (m_pressedIndex.has_value() && !m_selectionManager->isSelected(m_pressedIndex.value())) {
|
if (m_pressedIndex.has_value()) {
|
||||||
m_selectionManager->clearSelection();
|
if (!m_selectionManager->isSelected(m_pressedIndex.value())) {
|
||||||
m_selectionManager->setSelected(m_pressedIndex.value());
|
m_selectionManager->clearSelection();
|
||||||
|
m_selectionManager->setSelected(m_pressedIndex.value());
|
||||||
|
}
|
||||||
if (!m_selectionMode) {
|
if (!m_selectionMode) {
|
||||||
Q_EMIT selectionModeChangeRequested(true);
|
Q_EMIT selectionModeChangeRequested(true);
|
||||||
}
|
}
|
||||||
} else if (!m_pressedIndex.has_value()) {
|
} else {
|
||||||
m_selectionManager->clearSelection();
|
m_selectionManager->clearSelection();
|
||||||
startRubberBand();
|
startRubberBand();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue