mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-20 00:41:23 +00:00
Update current item and anchor item on mouse clicks
This commit is contained in:
parent
71ccc7e361
commit
3547357862
|
@ -131,10 +131,17 @@ bool KItemListController::inputMethodEvent(QInputMethodEvent* event)
|
|||
|
||||
bool KItemListController::mousePressEvent(QGraphicsSceneMouseEvent* event, const QTransform& transform)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
Q_UNUSED(transform);
|
||||
const QPointF pos = transform.map(event->pos());
|
||||
m_pressedIndex = m_view->itemAt(pos);
|
||||
|
||||
m_selectionManager->setCurrentItem(m_pressedIndex);
|
||||
|
||||
// The anchor for the current selection is updated except for Shift+LeftButton events
|
||||
// (the current selection is continued with the previous anchor in that case).
|
||||
if (!(event->buttons() & Qt::LeftButton && event->modifiers() & Qt::ShiftModifier)) {
|
||||
m_selectionManager->setAnchorItem(m_pressedIndex);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue