mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 21:57:41 +02:00
* Show correct artist/album/track pixmap when dragging from a GridView.
This commit is contained in:
@@ -360,7 +360,15 @@ GridView::startDrag( Qt::DropActions supportedActions )
|
||||
|
||||
QDrag* drag = new QDrag( this );
|
||||
drag->setMimeData( data );
|
||||
const QPixmap p = TomahawkUtils::createDragPixmap( TomahawkUtils::MediaTypeAlbum, indexes.count() );
|
||||
|
||||
QPixmap p;
|
||||
if ( data->hasFormat( "application/tomahawk.metadata.artist" ) )
|
||||
p = TomahawkUtils::createDragPixmap( TomahawkUtils::MediaTypeArtist, indexes.count() );
|
||||
else if ( data->hasFormat( "application/tomahawk.metadata.album" ) )
|
||||
p = TomahawkUtils::createDragPixmap( TomahawkUtils::MediaTypeAlbum, indexes.count() );
|
||||
else
|
||||
p = TomahawkUtils::createDragPixmap( TomahawkUtils::MediaTypeTrack, indexes.count() );
|
||||
|
||||
drag->setPixmap( p );
|
||||
drag->setHotSpot( QPoint( -20, -20 ) );
|
||||
|
||||
|
@@ -125,7 +125,6 @@ createDragPixmap( MediaType type, int itemCount )
|
||||
int y = 0;
|
||||
for ( int i = 0; i < itemCount; ++i )
|
||||
{
|
||||
|
||||
painter.drawPixmap( x, y, pixmap );
|
||||
|
||||
x += size + 1;
|
||||
|
Reference in New Issue
Block a user