X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/ecce6e87f8540aa690a2098d89e22b4ab85e325f..792ebd6691026d817442fe4a32a822a0ef68e767:/src/dolphindetailsview.cpp diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp index d90527767..bd2a75f61 100644 --- a/src/dolphindetailsview.cpp +++ b/src/dolphindetailsview.cpp @@ -207,10 +207,13 @@ void DolphinDetailsView::mouseMoveEvent(QMouseEvent* event) // case QTreeView does no selection at all, which is not the wanted behavior // in Dolphin -> select all items within the elastic band rectangle clearSelection(); - if (mousePos.x() < header()->sectionSize(DolphinModel::Name)) { - setSelection(QRect(m_elasticBandOrigin, m_elasticBandDestination), - QItemSelectionModel::Select); - } + + const int nameColumnWidth = header()->sectionSize(DolphinModel::Name); + QRect selRect = QRect(m_elasticBandOrigin, m_elasticBandDestination).normalized(); + const QRect nameColumnsRect(0, 0, nameColumnWidth, viewport()->height()); + selRect = nameColumnsRect.intersected(selRect); + + setSelection(selRect, QItemSelectionModel::Select); } QTreeView::mouseMoveEvent(event);