[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/apps/plasma/applets/folderview
From:       Aaron J. Seigo <aseigo () kde ! org>
Date:       2008-06-12 12:22:30
Message-ID: 1213273350.196808.10250.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 819861 by aseigo:

* don't paint dragging items as if they were still there
* repaint dragged items if the drag was cancelled


 M  +16 -2     folderview.cpp  


--- trunk/KDE/kdebase/apps/plasma/applets/folderview/folderview.cpp #819860:819861
@@ -347,8 +347,12 @@
         if (index == m_hoveredIndex)
             opt.state |= QStyle::State_MouseOver;
 
-        if (m_selectionModel->isSelected(index))
+        if (m_selectionModel->isSelected(index)) {
+            if (m_dragInProgress) {
+                continue;
+            }
             opt.state |= QStyle::State_Selected;
+        }
 
         if (hasFocus() && index == m_selectionModel->currentIndex())
             opt.state |= QStyle::State_HasFocus;
@@ -952,8 +956,18 @@
     drag->setMimeData(m_model->mimeData(indexes));
     drag->setPixmap(pixmap);
     drag->setHotSpot((pos - boundingRect.topLeft()).toPoint());
-    drag->exec(m_model->supportedDragActions());
+    Qt::DropAction result = drag->exec(m_model->supportedDragActions());
 
+    if (result == Qt::IgnoreAction) {
+        QRectF dirtyRect;
+        foreach (const QModelIndex &selected, m_selectionModel->selectedIndexes()) {
+            dirtyRect |= visualRect(selected);
+        }
+
+        if (!dirtyRect.isEmpty()) {
+            update(dirtyRect);
+        }
+    }
     m_dragInProgress = false;
 }
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic