diff options
| author | Nate Graham <[email protected]> | 2023-10-05 09:15:35 -0600 |
|---|---|---|
| committer | Nate Graham <[email protected]> | 2023-10-05 09:15:35 -0600 |
| commit | 30a807e44afb334dd153c8bcbdbde4f36942bee0 (patch) | |
| tree | f2bb4b386ac76e257f87689e75db7364c7a12f6c /src/kitemviews/kitemlistcontroller.cpp | |
| parent | b6d9cb9949111fbaf5c875e76619ca7af83c6fc3 (diff) | |
| parent | b58fead9beaf3165146d3e536b6b14ae1cc9514d (diff) | |
Merge branch 'master' into kf6
Diffstat (limited to 'src/kitemviews/kitemlistcontroller.cpp')
| -rw-r--r-- | src/kitemviews/kitemlistcontroller.cpp | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp index 0f3c5bc8c..be7a63e09 100644 --- a/src/kitemviews/kitemlistcontroller.cpp +++ b/src/kitemviews/kitemlistcontroller.cpp @@ -654,11 +654,6 @@ bool KItemListController::mouseMoveEvent(QGraphicsSceneMouseEvent *event, const if (m_view->scrollOrientation() == Qt::Vertical) { endPos.ry() += m_view->scrollOffset(); - if (m_view->itemSize().width() < 0) { - // Use a special rubberband for views that have only one column and - // expand the rubberband to use the whole width of the view. - endPos.setX(m_view->size().width()); - } } else { endPos.rx() += m_view->scrollOffset(); } @@ -1302,9 +1297,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); } } @@ -1809,11 +1804,6 @@ void KItemListController::startRubberBand() QPoint startPos = m_view->transform().map(m_view->scene()->views().first()->mapFromGlobal(m_pressedMouseGlobalPos.toPoint())); if (m_view->scrollOrientation() == Qt::Vertical) { startPos.ry() += m_view->scrollOffset(); - if (m_view->itemSize().width() < 0) { - // Use a special rubberband for views that have only one column and - // expand the rubberband to use the whole width of the view. - startPos.setX(0); - } } else { startPos.rx() += m_view->scrollOffset(); } |
