]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fixed "Eike Hein"-details-view-issue:
authorPeter Penz <peter.penz19@gmail.com>
Sat, 15 Dec 2007 17:11:13 +0000 (17:11 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Sat, 15 Dec 2007 17:11:13 +0000 (17:11 +0000)
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.

CCMAIL: hein@kde.org

svn path=/trunk/KDE/kdebase/apps/; revision=748830

src/dolphindetailsview.cpp

index d9052776774a8f759dcba247ebc13371161a7cce..bd2a75f61645110542cb76c1db5d820e279ceabe 100644 (file)
@@ -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);