mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-19 00:11:21 +00:00
Control-rubberband selection toggles the selection state
This commit is contained in:
parent
7f5fb3ae2c
commit
b01c73607b
|
@ -678,7 +678,16 @@ void KItemListController::slotRubberBandChanged()
|
|||
}
|
||||
} while (!selectionFinished);
|
||||
|
||||
m_selectionManager->setSelectedItems(selectedItems + m_oldSelection);
|
||||
if (QApplication::keyboardModifiers() & Qt::ControlModifier) {
|
||||
// If Control is pressed, the selection state of all items in the rubberband is toggled.
|
||||
// Therefore, the new selection contains:
|
||||
// 1. All previously selected items which are not inside the rubberband, and
|
||||
// 2. all items inside the rubberband which have not been selected previously.
|
||||
m_selectionManager->setSelectedItems((m_oldSelection - selectedItems) + (selectedItems - m_oldSelection));
|
||||
}
|
||||
else {
|
||||
m_selectionManager->setSelectedItems(selectedItems + m_oldSelection);
|
||||
}
|
||||
}
|
||||
|
||||
bool KItemListController::startDragging()
|
||||
|
|
Loading…
Reference in a new issue