diff options
| author | Marco Savelli <[email protected]> | 2023-09-18 22:53:49 +0200 |
|---|---|---|
| committer | Méven Car <[email protected]> | 2023-09-23 08:36:53 +0000 |
| commit | 2a4dd2aa43aeff54187955ed66e8462751bfed1c (patch) | |
| tree | 2aad6b4a3ccd8c3aa5cf907355bc97bde26744a6 /src/kitemviews/kitemlistcontroller.cpp | |
| parent | e08f6f9b58753d0438162b6cd2e2df65d6e20b35 (diff) | |
selection: select-on-rubberband-on-row as new default
Sets a rectangular, non-full-width rubberband as the new default.
User selection is made wherever the rubberband intersects with the row.
Diffstat (limited to 'src/kitemviews/kitemlistcontroller.cpp')
| -rw-r--r-- | src/kitemviews/kitemlistcontroller.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp index 0f3c5bc8c..d70028d23 100644 --- a/src/kitemviews/kitemlistcontroller.cpp +++ b/src/kitemviews/kitemlistcontroller.cpp @@ -1302,9 +1302,9 @@ void KItemListController::slotRubberBandChanged() const QRectF widgetRect = m_view->itemRect(index); if (widgetRect.intersects(rubberBandRect)) { - const QRectF iconRect = widget->iconRect().translated(widgetRect.topLeft()); - const QRectF textRect = widget->textRect().translated(widgetRect.topLeft()); - if (iconRect.intersects(rubberBandRect) || textRect.intersects(rubberBandRect)) { + // Select the full row intersecting with the rubberband rectangle + const QRectF selectionRect = widget->selectionRect().translated(widgetRect.topLeft()); + if (selectionRect.intersects(rubberBandRect)) { selectedItems.insert(index); } } |
