]> git.sesse.net Git - vlc/commitdiff
[Qt] Add an icon when dragging.
authorJean-Baptiste Kempf <jb@videolan.org>
Tue, 9 Dec 2008 20:03:55 +0000 (21:03 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Wed, 10 Dec 2008 08:15:32 +0000 (09:15 +0100)
This improves the user experience.

modules/gui/qt4/dialogs/toolbar.cpp

index c2ead90d6e438bdda30fc0321f335704e3b9264b..547c02f14f3e936bc1e3bed67b6cf9cd5e64f132 100644 (file)
@@ -329,8 +329,9 @@ void WidgetListing::startDrag( Qt::DropActions /*supportedActions*/ )
 
     QDrag *drag = new QDrag( this );
     drag->setMimeData( mimeData );
-//    drag->setHotSpot(QPoint(pixmap.width()/2, pixmap.height()/2));
-
+    QPixmap aPixmap = item->icon().pixmap( QSize( 22, 22 ) );
+    drag->setPixmap( aPixmap );
+    drag->setHotSpot( QPoint( 20, 20 ) );
     drag->exec(Qt::CopyAction | Qt::MoveAction );
 }