]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kitemlistcontroller.cpp
Fix rubberband selection on icon in icon view mode
[dolphin.git] / src / kitemviews / kitemlistcontroller.cpp
index 0016bb22aeb4fdf27f4c999ff3d6b7719a287ec1..5abf1830be349f2bd397e302920ffbfb3beef259 100644 (file)
@@ -1299,7 +1299,8 @@ void KItemListController::slotRubberBandChanged()
         if (widgetRect.intersects(rubberBandRect)) {
             // Select the full row intersecting with the rubberband rectangle
             const QRectF selectionRect = widget->selectionRect().translated(widgetRect.topLeft());
         if (widgetRect.intersects(rubberBandRect)) {
             // Select the full row intersecting with the rubberband rectangle
             const QRectF selectionRect = widget->selectionRect().translated(widgetRect.topLeft());
-            if (selectionRect.intersects(rubberBandRect)) {
+            const QRectF iconRect = widget->iconRect().translated(widgetRect.topLeft());
+            if (selectionRect.intersects(rubberBandRect) || iconRect.intersects(rubberBandRect)) {
                 selectedItems.insert(index);
             }
         }
                 selectedItems.insert(index);
             }
         }