m_longPressDetectionTimer->setInterval(QGuiApplication::styleHints()->mousePressAndHoldInterval());
connect(m_longPressDetectionTimer, &QTimer::timeout, this, [this]() {
if (!m_selectionMode) {
- Q_EMIT selectionModeRequested();
+ Q_EMIT selectionModeChangeRequested(true);
}
});
return m_singleClickActivationEnforced;
}
-void KItemListController::setSelectionMode(bool enabled)
+void KItemListController::setSelectionModeEnabled(bool enabled)
{
m_selectionMode = enabled;
}
}
case Qt::Key_Escape:
+ if (m_selectionMode && m_selectionManager->selectedItems().count() < 1) {
+ Q_EMIT selectionModeChangeRequested(false);
+ }
if (m_selectionBehavior != SingleSelection) {
m_selectionManager->clearSelection();
}
}
const bool shiftPressed = modifiers & Qt::ShiftModifier;
- const bool controlPressed = (modifiers & Qt::ControlModifier) || m_selectionMode;
+ const bool controlPressed = (modifiers & Qt::ControlModifier) || m_selectionMode; // Keeping selectionMode similar to pressing control will hopefully
+ // simplify the overall logic and possibilities both for users and devs.
const bool leftClick = buttons & Qt::LeftButton;
const bool rightClick = buttons & Qt::RightButton;