]> cloud.milkyroute.net Git - dolphin.git/commitdiff
selection: select-on-rubberband-on-row as new default
authorMarco Savelli <svlmrc@gmail.com>
Mon, 18 Sep 2023 20:53:49 +0000 (22:53 +0200)
committerMéven Car <meven.car@kdemail.net>
Sat, 23 Sep 2023 08:36:53 +0000 (08:36 +0000)
Sets a rectangular, non-full-width rubberband as the new default.
User selection is made wherever the rubberband intersects with the row.

src/kitemviews/kitemlistcontroller.cpp

index 0f3c5bc8cc8bdb494b52cf170c88d8d817b6cf70..d70028d23d32e5f7a929f72f6f372bb1a9d027b7 100644 (file)
@@ -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);
             }
         }