mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-22 01:40:02 +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:
parent
263935f9ed
commit
5c7887a763
|
@ -1299,7 +1299,8 @@ void KItemListController::slotRubberBandChanged()
|
||||||
if (widgetRect.intersects(rubberBandRect)) {
|
if (widgetRect.intersects(rubberBandRect)) {
|
||||||
// Select the full row intersecting with the rubberband rectangle
|
// Select the full row intersecting with the rubberband rectangle
|
||||||
const QRectF selectionRect = widget->selectionRect().translated(widgetRect.topLeft());
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue