From: Marco Savelli Date: Mon, 18 Sep 2023 20:53:49 +0000 (+0200) Subject: selection: select-on-rubberband-on-row as new default X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/2a4dd2aa43aeff54187955ed66e8462751bfed1c?ds=sidebyside 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. --- 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); } }