mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-02-24 03:43:56 +01:00
* Use new default artist placeholder image.
This commit is contained in:
parent
d0858efd7d
commit
243997b06e
@ -8,6 +8,7 @@
|
||||
<file>./data/images/loved.png</file>
|
||||
<file>./data/images/not-loved.png</file>
|
||||
<file>./data/images/no-album-art-placeholder.png</file>
|
||||
<file>./data/images/no-artist-image-placeholder.png</file>
|
||||
<file>./data/images/now-playing-panel.png</file>
|
||||
<file>./data/images/now-playing-speaker.png</file>
|
||||
<file>./data/images/pause-pressed.png</file>
|
||||
|
@ -40,7 +40,8 @@ TreeItemDelegate::TreeItemDelegate( ArtistView* parent, TreeProxyModel* proxy )
|
||||
, m_model( proxy )
|
||||
{
|
||||
m_nowPlayingIcon = QPixmap( RESPATH "images/now-playing-speaker.png" );
|
||||
m_defaultCover = QPixmap( RESPATH "images/no-album-art-placeholder.png" );
|
||||
m_defaultAlbumCover = QPixmap( RESPATH "images/no-album-art-placeholder.png" );
|
||||
m_defaultArtistImage = QPixmap( RESPATH "images/no-artist-image-placeholder.png" );
|
||||
}
|
||||
|
||||
|
||||
@ -134,7 +135,15 @@ TreeItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
|
||||
// painter->drawPixmap( r, QPixmap( RESPATH "images/cover-shadow.png" ) );
|
||||
|
||||
QPixmap scover;
|
||||
QPixmap cover = item->cover.isNull() ? m_defaultCover : item->cover;
|
||||
QPixmap cover = item->cover;
|
||||
if ( cover.isNull() )
|
||||
{
|
||||
if ( !item->artist().isNull() )
|
||||
cover = m_defaultArtistImage;
|
||||
else
|
||||
cover = m_defaultAlbumCover;
|
||||
}
|
||||
|
||||
if ( m_cache.contains( cover.cacheKey() ) )
|
||||
{
|
||||
scover = m_cache.value( cover.cacheKey() );
|
||||
|
@ -46,7 +46,8 @@ private:
|
||||
mutable QHash< qint64, QPixmap > m_cache;
|
||||
|
||||
QPixmap m_nowPlayingIcon;
|
||||
QPixmap m_defaultCover;
|
||||
QPixmap m_defaultAlbumCover;
|
||||
QPixmap m_defaultArtistImage;
|
||||
};
|
||||
|
||||
#endif // TREEITEMDELEGATE_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user