diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/dolphindetailsview.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp index 68b288b0b..d90527767 100644 --- a/src/dolphindetailsview.cpp +++ b/src/dolphindetailsview.cpp @@ -199,9 +199,24 @@ void DolphinDetailsView::mousePressEvent(QMouseEvent* event) void DolphinDetailsView::mouseMoveEvent(QMouseEvent* event) { - QTreeView::mouseMoveEvent(event); if (m_showElasticBand) { + const QPoint mousePos = event->pos(); + const QModelIndex index = indexAt(mousePos); + if (!index.isValid()) { + // the destination of the selection rectangle is above the viewport. In this + // 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); + } + } + + QTreeView::mouseMoveEvent(event); updateElasticBand(); + } else { + QTreeView::mouseMoveEvent(event); } } |
