]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Drag-pixmap fixes
authorPeter Penz <peter.penz19@gmail.com>
Tue, 12 Jun 2012 11:19:16 +0000 (13:19 +0200)
committerPeter Penz <peter.penz19@gmail.com>
Tue, 12 Jun 2012 11:21:17 +0000 (13:21 +0200)
- Don't use the selection-tinted icon when dragging a single item
- Decrease the vertical gap for the hotspot
- Prevent drawing tree-lines when dragging items for the Places Panel

CCBUG: 301624

src/kitemviews/kitemlistcontroller.cpp
src/kitemviews/kitemlistwidget.cpp
src/kitemviews/kstandarditemlistwidget.cpp

index 2c2101935aec1c3a2616482b4e3b826020bb6b90..76f7fa1cd6a76838ea8769d957c4c56a9d24c66c 100644 (file)
@@ -1084,9 +1084,7 @@ void KItemListController::startDragging()
     const QPixmap pixmap = m_view->createDragPixmap(selectedItems);
     drag->setPixmap(pixmap);
 
-    // TODO: The vertical hotspot of -24 should be replaced by the
-    // height of the QCursor-pixmap.
-    const QPoint hotSpot(pixmap.width() / 2, -24);
+    const QPoint hotSpot(pixmap.width() / 2, 0);
     drag->setHotSpot(hotSpot);
 
     drag->exec(Qt::MoveAction | Qt::CopyAction | Qt::LinkAction, Qt::CopyAction);
index 45329afb335b555f62b69cb14469005421490076..6d0cec232f2eed198d66ade829cbc0db01783d59 100644 (file)
@@ -370,8 +370,13 @@ QPixmap KItemListWidget::createDragPixmap(const QStyleOptionGraphicsItem* option
 
     const bool oldAlternateBackground = m_alternateBackground;
     setAlternateBackground(false);
+    const bool wasSelected = m_selected;
+    setSelected(false);
+
     paint(&painter, option, widget);
+
     setAlternateBackground(oldAlternateBackground);
+    setSelected(wasSelected);
 
     return pixmap;
 }
index d87ae949776ca2257017fedb522d28252ce11aef..acd426cf25d73b3039cfa6b9712a55203be18836 100644 (file)
@@ -411,7 +411,7 @@ QPixmap KStandardItemListWidget::createDragPixmap(const QStyleOptionGraphicsItem
                                                   QWidget* widget)
 {
     QPixmap pixmap = KItemListWidget::createDragPixmap(option, widget);
-    if (m_layout != DetailsLayout || styleOption().extendedSelectionRegion) {
+    if (m_layout != DetailsLayout) {
         return pixmap;
     }