1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-05 13:47:26 +02:00

* Use defaultPixmap() in TreeItemDelegate.

This commit is contained in:
Christian Muehlhaeuser
2012-03-13 03:49:02 +01:00
parent 6409113c0e
commit 2e6688f42b
2 changed files with 2 additions and 8 deletions

View File

@@ -39,9 +39,6 @@ TreeItemDelegate::TreeItemDelegate( ArtistView* parent, TreeProxyModel* proxy )
, m_view( parent ) , m_view( parent )
, m_model( proxy ) , m_model( proxy )
{ {
m_nowPlayingIcon = QPixmap( RESPATH "images/now-playing-speaker.png" );
m_defaultAlbumCover = QPixmap( RESPATH "images/no-album-no-case.png" );
m_defaultArtistImage = QPixmap( RESPATH "images/no-artist-image-placeholder.png" );
} }
@@ -112,7 +109,8 @@ TreeItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
if ( item->isPlaying() && m_view->header()->visualIndex( index.column() ) == 0 ) if ( item->isPlaying() && m_view->header()->visualIndex( index.column() ) == 0 )
{ {
r.adjust( 0, 0, 0, -3 ); r.adjust( 0, 0, 0, -3 );
painter->drawPixmap( r.adjusted( 3, 1, 18 - r.width(), 1 ), m_nowPlayingIcon ); QRect npr = r.adjusted( 3, 1, 18 - r.width(), 1 );
painter->drawPixmap( npr, TomahawkUtils::defaultPixmap( TomahawkUtils::NowPlayingSpeaker, TomahawkUtils::Original, npr.size() ) );
r.adjust( 25, 0, 0, 3 ); r.adjust( 25, 0, 0, 3 );
} }

View File

@@ -42,10 +42,6 @@ protected:
private: private:
ArtistView* m_view; ArtistView* m_view;
TreeProxyModel* m_model; TreeProxyModel* m_model;
QPixmap m_nowPlayingIcon;
QPixmap m_defaultAlbumCover;
QPixmap m_defaultArtistImage;
}; };
#endif // TREEITEMDELEGATE_H #endif // TREEITEMDELEGATE_H