┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews
diff options
context:
space:
mode:
authorFrank Reininghaus <[email protected]>2011-08-28 19:16:14 +0200
committerFrank Reininghaus <[email protected]>2011-08-28 19:16:14 +0200
commitb01c73607be9974032a15a4b8ab39d5379991cb6 (patch)
treefe886b0b1be508acd6a9e0ae60d724fe6f3a72d3 /src/kitemviews
parent7f5fb3ae2c8db3fe513f280282b98db65ccbce6a (diff)
Control-rubberband selection toggles the selection state
Diffstat (limited to 'src/kitemviews')
-rw-r--r--src/kitemviews/kitemlistcontroller.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp
index 5eae95e6d..c0875ce39 100644
--- a/src/kitemviews/kitemlistcontroller.cpp
+++ b/src/kitemviews/kitemlistcontroller.cpp
@@ -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()