1
0
mirror of https://invent.kde.org/system/dolphin synced 2024-07-07 10:51:45 +00:00

Fix rubberband selection on icon in icon view mode

As an unintended side-effect of d9a18b04ea
items would no longer be selected in icon view mode when the selection
rectangle intersected with the item's icon. This commit fixes this.
This commit is contained in:
Felix Ernst 2023-10-23 14:26:52 +00:00
parent 263935f9ed
commit 5c7887a763

View 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 (selectionRect.intersects(rubberBandRect)) {
const QRectF iconRect = widget->iconRect().translated(widgetRect.topLeft());
if (selectionRect.intersects(rubberBandRect) || iconRect.intersects(rubberBandRect)) {
selectedItems.insert(index);
}
}