From fb4907dc6d8f3e74d3f7f519b5bbb6af546912b5 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 15 Dec 2007 17:11:13 +0000 Subject: Fixed "Eike Hein"-details-view-issue: 1. Open a Dolphin window 2. Switch to Details view 3. Navigate to a folder with a dozen or so items 4. Size the window so that there is an empty space below    the items 5. Move the mouse pointer below the items 6. Click and hold the mouse button, and move the pointer    upward to select all items in the list using the rect.    While selecting in this manner, move the pointer so    high that it is above the list headers in the toolbar.    Then, while still holding the mouse button and being    outside the listview's rect, move the pointer left out    of the window. Now with the pointer outside of the    window, move the pointer down into the area below the    list items, so that the selection rectangle no longer    intersects with the items. Notice they're still all    selected. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CCMAIL: hein@kde.org svn path=/trunk/KDE/kdebase/apps/; revision=748830 --- src/dolphindetailsview.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to '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); -- cgit v1.3