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

make collectionitems icons used not hardcoded, and add supercollection icon

This commit is contained in:
Leo Franchi
2011-04-02 00:01:42 -04:00
parent 9ee970489c
commit 4eaff359f0
6 changed files with 16 additions and 3 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

View File

@@ -76,6 +76,9 @@
<file>./data/images/music-icon.png</file> <file>./data/images/music-icon.png</file>
<file>./data/images/configure.png</file> <file>./data/images/configure.png</file>
<file>./data/images/create-playlist.png</file> <file>./data/images/create-playlist.png</file>
<file>./data/images/add.png</file>
<file>./data/images/recently-played.png</file>
<file>./data/images/supercollection.png</file>
<file>./data/topbar-radiobuttons.css</file> <file>./data/topbar-radiobuttons.css</file>
<file>./data/icons/tomahawk-icon-16x16.png</file> <file>./data/icons/tomahawk-icon-16x16.png</file>
<file>./data/icons/tomahawk-icon-32x32.png</file> <file>./data/icons/tomahawk-icon-32x32.png</file>

View File

@@ -39,7 +39,7 @@ SourcesModel::SourcesModel( QObject* parent )
appendItem( source_ptr() ); appendItem( source_ptr() );
// add misc children of root node // add misc children of root node
GenericPageItem* recent = new GenericPageItem( this, m_rootItem->children().at( 0 ), tr( "Recently Played" ), QIcon( RESPATH "images/home.png" ) ); GenericPageItem* recent = new GenericPageItem( this, m_rootItem->children().at( 0 ), tr( "Recently Played" ), QIcon( RESPATH "images/recently-played.png" ) );
connect( recent, SIGNAL( activated() ), PlaylistManager::instance(), SLOT( showWelcomePage() ) ); connect( recent, SIGNAL( activated() ), PlaylistManager::instance(), SLOT( showWelcomePage() ) );
onSourcesAdded( SourceList::instance()->sources() ); onSourcesAdded( SourceList::instance()->sources() );

View File

@@ -276,7 +276,7 @@ CategoryAddItem::flags() const
QIcon QIcon
CategoryAddItem::icon() const CategoryAddItem::icon() const
{ {
return QIcon( RESPATH "images/create-playlist.png" ); return QIcon( RESPATH "images/add.png" );
} }
// CategoryItem // CategoryItem
@@ -374,6 +374,15 @@ CollectionItem::activate()
} }
} }
QIcon
CollectionItem::icon() const
{
if( m_source.isNull() )
return QIcon( RESPATH "images/supercollection.png" );
else
return QIcon( RESPATH "images/user-avatar.png" );
}
void void
CollectionItem::onPlaylistsAdded( const QList< playlist_ptr >& playlists ) CollectionItem::onPlaylistsAdded( const QList< playlist_ptr >& playlists )

View File

@@ -128,6 +128,7 @@ public:
virtual QString text() const; virtual QString text() const;
virtual void activate(); virtual void activate();
virtual QIcon icon() const;
Tomahawk::source_ptr source() const; Tomahawk::source_ptr source() const;

View File

@@ -466,7 +466,7 @@ SourceDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, co
} }
QRect iconRect = option.rect.adjusted( 4, 6, -option.rect.width() + option.rect.height() - 12 + 4, -6 ); QRect iconRect = option.rect.adjusted( 4, 6, -option.rect.width() + option.rect.height() - 12 + 4, -6 );
painter->drawPixmap( iconRect, QPixmap( RESPATH "images/user-avatar.png" ).scaledToHeight( iconRect.height(), Qt::SmoothTransformation ) ); painter->drawPixmap( iconRect, item->icon().pixmap( iconRect.size() ) );
if ( ( option.state & QStyle::State_Selected ) == QStyle::State_Selected ) if ( ( option.state & QStyle::State_Selected ) == QStyle::State_Selected )
{ {