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

* Replace a ton more old PNGs with new SVG icon-set.

This commit is contained in:
Christian Muehlhaeuser
2012-12-07 03:49:25 +01:00
parent 59e8cdc451
commit c12f7ba5ad
40 changed files with 216 additions and 175 deletions

View File

@@ -22,7 +22,7 @@ QRadioButton::indicator::unchecked {
image: url(:/data/images/view-toggle-icon-list-inactive.svg); image: url(:/data/images/view-toggle-icon-list-inactive.svg);
} }
QRadioButton::indicator::checked { QRadioButton::indicator::checked {
background-image: url(:/data/images/view-toggle-active-centre.png); background-image: url(:/data/images/view-toggle-active-centre.svg);
image: url(:/data/images/view-toggle-icon-list-active.svg); image: url(:/data/images/view-toggle-icon-list-active.svg);
} }
QRadioButton::indicator::pressed { QRadioButton::indicator::pressed {
@@ -34,7 +34,7 @@ QRadioButton#radioNormal::indicator::unchecked {
image: url(:/data/images/view-toggle-icon-artist-inactive.svg); image: url(:/data/images/view-toggle-icon-artist-inactive.svg);
} }
QRadioButton#radioNormal::indicator::checked { QRadioButton#radioNormal::indicator::checked {
background-image: url(:/data/images/view-toggle-active-left.png); background-image: url(:/data/images/view-toggle-active-left.svg);
image: url(:/data/images/view-toggle-icon-artist-active.svg); image: url(:/data/images/view-toggle-icon-artist-active.svg);
} }
QRadioButton#radioNormal::indicator::pressed { QRadioButton#radioNormal::indicator::pressed {
@@ -46,7 +46,7 @@ QRadioButton#radioCloud::indicator::unchecked {
image: url(:/data/images/view-toggle-icon-grid-inactive.svg); image: url(:/data/images/view-toggle-icon-grid-inactive.svg);
} }
QRadioButton#radioCloud::indicator::checked { QRadioButton#radioCloud::indicator::checked {
background-image: url(:/data/images/view-toggle-active-right.png); background-image: url(:/data/images/view-toggle-active-right.svg);
image: url(:/data/images/view-toggle-icon-grid-active.svg); image: url(:/data/images/view-toggle-icon-grid-active.svg);
} }
QRadioButton#radioCloud::indicator::pressed { QRadioButton#radioCloud::indicator::pressed {

View File

@@ -9,7 +9,6 @@
<file>data/images/no-artist-image-placeholder.svg</file> <file>data/images/no-artist-image-placeholder.svg</file>
<file>data/images/artist-placeholder-grid.svg</file> <file>data/images/artist-placeholder-grid.svg</file>
<file>data/images/album-placeholder-grid.svg</file> <file>data/images/album-placeholder-grid.svg</file>
<file>data/images/track-placeholder.png</file>
<file>data/images/track-placeholder-grid.svg</file> <file>data/images/track-placeholder-grid.svg</file>
<file>data/images/now-playing-panel.png</file> <file>data/images/now-playing-panel.png</file>
<file>data/images/now-playing-speaker.svg</file> <file>data/images/now-playing-speaker.svg</file>
@@ -36,13 +35,11 @@
<file>data/images/skip-pressed.svg</file> <file>data/images/skip-pressed.svg</file>
<file>data/images/skip-rest.svg</file> <file>data/images/skip-rest.svg</file>
<file>data/images/user-avatar.svg</file> <file>data/images/user-avatar.svg</file>
<file>data/images/view-toggle-active-centre.png</file> <file>data/images/view-toggle-active-centre.svg</file>
<file>data/images/view-toggle-active-left.png</file> <file>data/images/view-toggle-active-left.svg</file>
<file>data/images/view-toggle-active-right.png</file> <file>data/images/view-toggle-active-right.svg</file>
<file>data/images/view-toggle-icon-artist-active.svg</file> <file>data/images/view-toggle-icon-artist-active.svg</file>
<file>data/images/view-toggle-icon-artist-inactive.svg</file> <file>data/images/view-toggle-icon-artist-inactive.svg</file>
<file>data/images/view-toggle-icon-cloud-active.png</file>
<file>data/images/view-toggle-icon-cloud-inactive.png</file>
<file>data/images/view-toggle-icon-grid-active.svg</file> <file>data/images/view-toggle-icon-grid-active.svg</file>
<file>data/images/view-toggle-icon-grid-inactive.svg</file> <file>data/images/view-toggle-icon-grid-inactive.svg</file>
<file>data/images/view-toggle-icon-list-active.svg</file> <file>data/images/view-toggle-icon-list-active.svg</file>
@@ -67,31 +64,30 @@
<file>data/images/info.svg</file> <file>data/images/info.svg</file>
<file>data/images/back.svg</file> <file>data/images/back.svg</file>
<file>data/images/forward.svg</file> <file>data/images/forward.svg</file>
<file>data/images/music-icon.png</file>
<file>data/images/configure.svg</file> <file>data/images/configure.svg</file>
<file>data/images/private-listening.png</file> <file>data/images/private-listening.svg</file>
<file>data/images/add.png</file> <file>data/images/add.svg</file>
<file>data/images/recently-played.png</file> <file>data/images/recently-played.svg</file>
<file>data/images/supercollection.svg</file> <file>data/images/supercollection.svg</file>
<file>data/images/sipplugin-online.png</file> <file>data/images/sipplugin-online.svg</file>
<file>data/images/sipplugin-offline.png</file> <file>data/images/sipplugin-offline.svg</file>
<file>data/images/advanced-settings.svg</file> <file>data/images/advanced-settings.svg</file>
<file>data/images/account-settings.svg</file> <file>data/images/account-settings.svg</file>
<file>data/images/music-settings.svg</file> <file>data/images/music-settings.svg</file>
<file>data/images/automatic-playlist.png</file> <file>data/images/automatic-playlist.svg</file>
<file>data/images/station.svg</file> <file>data/images/station.svg</file>
<file>data/images/new-additions.svg</file> <file>data/images/new-additions.svg</file>
<file>data/images/charts.svg</file> <file>data/images/charts.svg</file>
<file>data/images/new-releases.svg</file> <file>data/images/new-releases.svg</file>
<file>data/images/loved_playlist.svg</file> <file>data/images/loved_playlist.svg</file>
<file>data/images/dashboard.svg</file> <file>data/images/dashboard.svg</file>
<file>data/images/artist-icon.png</file> <file>data/images/artist-icon.svg</file>
<file>data/images/album-icon.svg</file> <file>data/images/album-icon.svg</file>
<file>data/images/track-icon.svg</file> <file>data/images/track-icon.svg</file>
<file>data/images/search-icon.png</file> <file>data/images/search-icon.svg</file>
<file>data/images/star-hover.png</file> <file>data/images/star-hover.svg</file>
<file>data/images/starred.png</file> <file>data/images/starred.svg</file>
<file>data/images/star-unstarred.png</file> <file>data/images/star-unstarred.svg</file>
<file>data/images/apply-check.svg</file> <file>data/images/apply-check.svg</file>
<file>data/stylesheets/topbar-radiobuttons.css</file> <file>data/stylesheets/topbar-radiobuttons.css</file>
<file>data/icons/tomahawk-icon-16x16.png</file> <file>data/icons/tomahawk-icon-16x16.png</file>
@@ -111,23 +107,23 @@
<file>data/sql/dbmigrate-27_to_28.sql</file> <file>data/sql/dbmigrate-27_to_28.sql</file>
<file>data/sql/dbmigrate-28_to_29.sql</file> <file>data/sql/dbmigrate-28_to_29.sql</file>
<file>data/js/tomahawk.js</file> <file>data/js/tomahawk.js</file>
<file>data/images/drop-all-songs.png</file> <file>data/images/drop-all-songs.svg</file>
<file>data/images/drop-local-songs.png</file> <file>data/images/drop-local-songs.svg</file>
<file>data/images/drop-top-songs.png</file> <file>data/images/drop-top-songs.svg</file>
<file>data/images/drop-song.png</file> <file>data/images/drop-song.svg</file>
<file>data/images/drop-album.png</file> <file>data/images/drop-album.svg</file>
<file>data/images/spotify-logo.png</file> <file>data/images/spotify-logo.png</file>
<file>data/images/itunes.png</file> <file>data/images/itunes.png</file>
<file>data/images/uploading.svg</file> <file>data/images/uploading.svg</file>
<file>data/images/downloading.svg</file> <file>data/images/downloading.svg</file>
<file>data/images/headphones-off.png</file> <file>data/images/headphones-off.svg</file>
<file>data/images/closed-padlock.png</file> <file>data/images/closed-padlock.svg</file>
<file>data/images/open-padlock.svg</file> <file>data/images/open-padlock.svg</file>
<file>data/images/headphones.svg</file> <file>data/images/headphones.svg</file>
<file>data/images/no-album-no-case.svg</file> <file>data/images/no-album-no-case.svg</file>
<file>data/images/rdio.png</file> <file>data/images/rdio.png</file>
<file>data/images/grooveshark.png</file> <file>data/images/grooveshark.png</file>
<file>data/images/lastfm-icon.png</file> <file>data/images/lastfm-icon.svg</file>
<file>data/images/spotifycore-logo.png</file> <file>data/images/spotifycore-logo.png</file>
<file>data/images/share.svg</file> <file>data/images/share.svg</file>
<file>data/images/process-stop.svg</file> <file>data/images/process-stop.svg</file>
@@ -140,16 +136,16 @@
<file>data/images/subscribe-on.svg</file> <file>data/images/subscribe-on.svg</file>
<file>data/images/subscribe-off.svg</file> <file>data/images/subscribe-off.svg</file>
<file>data/images/add-contact.svg</file> <file>data/images/add-contact.svg</file>
<file>data/images/account-none.png</file> <file>data/images/account-none.svg</file>
<file>data/images/green-dot.svg</file> <file>data/images/green-dot.svg</file>
<file>data/images/exfm.png</file> <file>data/images/exfm.png</file>
<file>data/images/soundcloud.png</file> <file>data/images/soundcloud.svg</file>
<file>data/images/resolver-default.svg</file> <file>data/images/resolver-default.svg</file>
<file>data/images/spotify-sourceicon.png</file> <file>data/images/spotify-sourceicon.svg</file>
<file>data/images/account-offline.png</file> <file>data/images/account-offline.svg</file>
<file>data/images/account-online.png</file> <file>data/images/account-online.svg</file>
<file>data/images/cancel.svg</file> <file>data/images/cancel.svg</file>
<file>data/images/delete.svg</file> <file>data/images/delete.svg</file>
<file>data/images/ok.png</file> <file>data/images/ok.svg</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@@ -67,7 +67,7 @@ SocialWidget::SocialWidget( QWidget* parent )
ui->charsLeftLabel->setForegroundRole( QPalette::Text ); ui->charsLeftLabel->setForegroundRole( QPalette::Text );
ui->charsLeftLabel->setStyleSheet( "text: black" ); ui->charsLeftLabel->setStyleSheet( "text: black" );
ui->buttonBox->button( QDialogButtonBox::Ok )->setText( tr( "Tweet" ) ); ui->buttonBox->button( QDialogButtonBox::Ok )->setText( tr( "Tweet" ) );
ui->buttonBox->button( QDialogButtonBox::Ok )->setIcon( ImageRegistry::instance()->icon( RESPATH "images/ok.png" ) ); ui->buttonBox->button( QDialogButtonBox::Ok )->setIcon( ImageRegistry::instance()->icon( RESPATH "images/ok.svg" ) );
ui->buttonBox->button( QDialogButtonBox::Cancel )->setIcon( ImageRegistry::instance()->icon( RESPATH "images/cancel.svg" ) ); ui->buttonBox->button( QDialogButtonBox::Cancel )->setIcon( ImageRegistry::instance()->icon( RESPATH "images/cancel.svg" ) );
ui->textEdit->setStyleSheet( "border: 1px solid " + TomahawkUtils::Colors::BORDER_LINE.name() ); ui->textEdit->setStyleSheet( "border: 1px solid " + TomahawkUtils::Colors::BORDER_LINE.name() );

View File

@@ -57,10 +57,10 @@ void
ActionCollection::initActions() ActionCollection::initActions()
{ {
QAction *latchOn = new QAction( tr( "&Listen Along" ), this ); QAction *latchOn = new QAction( tr( "&Listen Along" ), this );
latchOn->setIcon( QIcon( RESPATH "images/headphones-sidebar.png" ) ); latchOn->setIcon( ImageRegistry::instance()->icon( RESPATH "images/headphones.svg" ) );
m_actionCollection[ "latchOn" ] = latchOn; m_actionCollection[ "latchOn" ] = latchOn;
QAction *latchOff = new QAction( tr( "Stop &Listening Along" ), this ); QAction *latchOff = new QAction( tr( "Stop &Listening Along" ), this );
latchOff->setIcon( QIcon( RESPATH "images/headphones-off.png" ) ); latchOff->setIcon( ImageRegistry::instance()->icon( RESPATH "images/headphones-off.svg" ) );
m_actionCollection[ "latchOff" ] = latchOff; m_actionCollection[ "latchOff" ] = latchOff;
QAction *realtimeFollowingAlong = new QAction( tr( "&Follow in real-time" ), this ); QAction *realtimeFollowingAlong = new QAction( tr( "&Follow in real-time" ), this );
@@ -69,7 +69,7 @@ ActionCollection::initActions()
bool isPublic = TomahawkSettings::instance()->privateListeningMode() == TomahawkSettings::PublicListening; bool isPublic = TomahawkSettings::instance()->privateListeningMode() == TomahawkSettings::PublicListening;
QAction *privacyToggle = new QAction( ( isPublic ? tr( "&Listen Privately" ) : tr( "&Listen Publicly" ) ), this ); QAction *privacyToggle = new QAction( ( isPublic ? tr( "&Listen Privately" ) : tr( "&Listen Publicly" ) ), this );
privacyToggle->setIcon( QIcon( RESPATH "images/private-listening.png" ) ); privacyToggle->setIcon( ImageRegistry::instance()->icon( RESPATH "images/private-listening.svg" ) );
privacyToggle->setIconVisibleInMenu( isPublic ); privacyToggle->setIconVisibleInMenu( isPublic );
m_actionCollection[ "togglePrivacy" ] = privacyToggle; m_actionCollection[ "togglePrivacy" ] = privacyToggle;
connect( m_actionCollection[ "togglePrivacy" ], SIGNAL( triggered() ), SLOT( togglePrivateListeningMode() ), Qt::UniqueConnection ); connect( m_actionCollection[ "togglePrivacy" ], SIGNAL( triggered() ), SLOT( togglePrivateListeningMode() ), Qt::UniqueConnection );

View File

@@ -393,7 +393,7 @@ ViewManager::showRecentPlaysPage()
if ( !m_recentPlaysWidget ) if ( !m_recentPlaysWidget )
{ {
FlexibleView* pv = new FlexibleView( m_widget ); FlexibleView* pv = new FlexibleView( m_widget );
pv->setPixmap( QPixmap( RESPATH "images/recently-played.png" ) ); pv->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::RecentlyPlayed ) );
RecentlyPlayedModel* raModel = new RecentlyPlayedModel( pv ); RecentlyPlayedModel* raModel = new RecentlyPlayedModel( pv );
raModel->setTitle( tr( "Recently Played Tracks" ) ); raModel->setTitle( tr( "Recently Played Tracks" ) );

View File

@@ -60,21 +60,6 @@ AccountDelegate::AccountDelegate( QObject* parent )
, m_accountRowHeight( -1 ) , m_accountRowHeight( -1 )
, m_model( 0 ) , m_model( 0 )
{ {
m_defaultCover.load( RESPATH "images/sipplugin-online.png" );
m_ratingStarPositive.load( RESPATH "images/starred.png" );
m_ratingStarNegative.load( RESPATH "images/star-unstarred.png" );
m_onHoverStar.load( RESPATH "images/star-hover.png" );
m_onlineIcon.load( RESPATH "images/sipplugin-online.png" );
m_offlineIcon.load( RESPATH "images/sipplugin-offline.png" );
m_ratingStarPositive = m_ratingStarPositive.scaled( STAR_SIZE, STAR_SIZE, Qt::KeepAspectRatio, Qt::SmoothTransformation );
m_ratingStarNegative = m_ratingStarNegative.scaled( STAR_SIZE, STAR_SIZE, Qt::KeepAspectRatio, Qt::SmoothTransformation );
m_onlineIcon = m_onlineIcon.scaled( STATUS_ICON_SIZE, STATUS_ICON_SIZE, Qt::KeepAspectRatio, Qt::SmoothTransformation );
m_offlineIcon = m_offlineIcon.scaled( STATUS_ICON_SIZE, STATUS_ICON_SIZE, Qt::KeepAspectRatio, Qt::SmoothTransformation );
m_onHoverStar = m_onHoverStar.scaled( STAR_SIZE, STAR_SIZE, Qt::KeepAspectRatio, Qt::SmoothTransformation );
m_defaultCover = m_defaultCover.scaled( ICONSIZE, ICONSIZE, Qt::KeepAspectRatio, Qt::SmoothTransformation );
} }
@@ -186,7 +171,7 @@ AccountDelegate::paint ( QPainter* painter, const QStyleOptionViewItem& option,
QPixmap p = index.data( Qt::DecorationRole ).value< QPixmap >(); QPixmap p = index.data( Qt::DecorationRole ).value< QPixmap >();
QRect pixmapRect( leftEdge + PADDING, center - ICONSIZE/2, ICONSIZE, ICONSIZE ); QRect pixmapRect( leftEdge + PADDING, center - ICONSIZE/2, ICONSIZE, ICONSIZE );
if ( p.isNull() ) // default image... TODO if ( p.isNull() ) // default image... TODO
p = m_defaultCover; p = TomahawkUtils::defaultPixmap( TomahawkUtils::SipPluginOnline, TomahawkUtils::Original, pixmapRect.size() );
else else
p = p.scaled( pixmapRect.size(), Qt::KeepAspectRatio, Qt::SmoothTransformation ); p = p.scaled( pixmapRect.size(), Qt::KeepAspectRatio, Qt::SmoothTransformation );
@@ -350,7 +335,7 @@ AccountDelegate::paint ( QPainter* painter, const QStyleOptionViewItem& option,
int starsTop = runningBottom + PADDING; int starsTop = runningBottom + PADDING;
for ( int i = 1; i < 6; i++ ) for ( int i = 1; i < 6; i++ )
{ {
QRect r( runningEdge, starsTop, m_ratingStarPositive.width(), m_ratingStarPositive.height() ); QRect r( runningEdge, starsTop, STAR_SIZE, STAR_SIZE );
// QRect r( runningEdge, opt.rect.top() + PADDING, m_ratingStarPositive.width(), m_ratingStarPositive.height() ); // QRect r( runningEdge, opt.rect.top() + PADDING, m_ratingStarPositive.width(), m_ratingStarPositive.height() );
if ( i == 1 ) if ( i == 1 )
m_cachedStarRects[ index ] = r; m_cachedStarRects[ index ] = r;
@@ -361,23 +346,23 @@ AccountDelegate::paint ( QPainter* painter, const QStyleOptionViewItem& option,
m_hoveringItem == index ) m_hoveringItem == index )
{ {
if ( i <= m_hoveringOver ) // positive star if ( i <= m_hoveringOver ) // positive star
painter->drawPixmap( r, m_onHoverStar ); painter->drawPixmap( r, TomahawkUtils::defaultPixmap( TomahawkUtils::StarHovered, TomahawkUtils::Original, r.size() ) );
else else
painter->drawPixmap( r, m_ratingStarNegative ); painter->drawPixmap( r, TomahawkUtils::defaultPixmap( TomahawkUtils::Unstarred, TomahawkUtils::Original, r.size() ) );
} }
else else
{ {
if ( i <= rating ) // positive or rated star if ( i <= rating ) // positive or rated star
{ {
if ( userHasRated ) if ( userHasRated )
painter->drawPixmap( r, m_onHoverStar ); painter->drawPixmap( r, TomahawkUtils::defaultPixmap( TomahawkUtils::StarHovered, TomahawkUtils::Original, r.size() ) );
else else
painter->drawPixmap( r, m_ratingStarPositive ); painter->drawPixmap( r, TomahawkUtils::defaultPixmap( TomahawkUtils::Starred, TomahawkUtils::Original, r.size() ) );
} }
else else
painter->drawPixmap( r, m_ratingStarNegative ); painter->drawPixmap( r, TomahawkUtils::defaultPixmap( TomahawkUtils::Unstarred, TomahawkUtils::Original, r.size() ) );
} }
runningEdge += m_ratingStarPositive.width() + PADDING_BETWEEN_STARS; runningEdge += STAR_SIZE + PADDING_BETWEEN_STARS;
} }
// downloaded num times // downloaded num times
@@ -508,7 +493,7 @@ AccountDelegate::editorEvent( QEvent* event, QAbstractItemModel* model, const QS
if ( m_cachedStarRects.contains( index ) ) if ( m_cachedStarRects.contains( index ) )
{ {
QRect fullStars = m_cachedStarRects[ index ]; QRect fullStars = m_cachedStarRects[ index ];
const int starsWidth = 5 * ( m_ratingStarPositive.width() + PADDING_BETWEEN_STARS ); const int starsWidth = 5 * ( STAR_SIZE + PADDING_BETWEEN_STARS );
fullStars.setWidth( starsWidth ); fullStars.setWidth( starsWidth );
QMouseEvent* me = static_cast< QMouseEvent* >( event ); QMouseEvent* me = static_cast< QMouseEvent* >( event );
@@ -560,26 +545,26 @@ AccountDelegate::drawStatus( QPainter* painter, const QPointF& rightTopEdge, Acc
QPixmap p; QPixmap p;
QString statusText; QString statusText;
const int yPos = rightTopEdge.y();
const QRect connectIconRect( rightTopEdge.x() - STATUS_ICON_SIZE, yPos, STATUS_ICON_SIZE, STATUS_ICON_SIZE );
const Account::ConnectionState state = acct->connectionState(); const Account::ConnectionState state = acct->connectionState();
if ( state == Account::Connected ) if ( state == Account::Connected )
{ {
p = m_onlineIcon; p = TomahawkUtils::defaultPixmap( TomahawkUtils::SipPluginOnline, TomahawkUtils::Original, connectIconRect.size() );
statusText = tr( "Online" ); statusText = tr( "Online" );
} }
else if ( state == Account::Connecting ) else if ( state == Account::Connecting )
{ {
p = m_offlineIcon; p = TomahawkUtils::defaultPixmap( TomahawkUtils::SipPluginOffline, TomahawkUtils::Original, connectIconRect.size() );
statusText = tr( "Connecting..." ); statusText = tr( "Connecting..." );
} }
else else
{ {
p = m_offlineIcon; p = TomahawkUtils::defaultPixmap( TomahawkUtils::SipPluginOffline, TomahawkUtils::Original, connectIconRect.size() );
statusText = tr( "Offline" ); statusText = tr( "Offline" );
} }
const int yPos = rightTopEdge.y();
const QRect connectIconRect( rightTopEdge.x() - STATUS_ICON_SIZE, yPos, STATUS_ICON_SIZE, STATUS_ICON_SIZE );
if ( state == Account::Connecting ) if ( state == Account::Connecting )
{ {
if ( !m_connectingSpinners.contains( acct ) ) if ( !m_connectingSpinners.contains( acct ) )

View File

@@ -70,7 +70,6 @@ private:
QRect checkRectForIndex( const QStyleOptionViewItem &option, const QModelIndex &idx ) const; QRect checkRectForIndex( const QStyleOptionViewItem &option, const QModelIndex &idx ) const;
QPixmap m_offlineIcon, m_onlineIcon, m_defaultCover, m_onHoverStar, m_ratingStarPositive, m_ratingStarNegative;
int m_hoveringOver; int m_hoveringOver;
QPersistentModelIndex m_hoveringItem, m_configPressed; QPersistentModelIndex m_hoveringItem, m_configPressed;
mutable QHash< QPersistentModelIndex, QRect > m_cachedButtonRects; mutable QHash< QPersistentModelIndex, QRect > m_cachedButtonRects;
@@ -85,6 +84,7 @@ private:
}; };
} }
} }
#endif // ACCOUNTDELEGATE_H #endif // ACCOUNTDELEGATE_H

View File

@@ -34,16 +34,13 @@ using namespace Tomahawk::Accounts;
#define CONFIG_WRENCH_SIZE 20 #define CONFIG_WRENCH_SIZE 20
#define PADDING 4 #define PADDING 4
AccountFactoryWrapperDelegate::AccountFactoryWrapperDelegate( QObject* parent ) AccountFactoryWrapperDelegate::AccountFactoryWrapperDelegate( QObject* parent )
: QStyledItemDelegate( parent ) : QStyledItemDelegate( parent )
{ {
m_onlineIcon.load( RESPATH "images/sipplugin-online.png" );
m_offlineIcon.load( RESPATH "images/sipplugin-offline.png" );
m_onlineIcon = m_onlineIcon.scaled( ICON_SIZE, ICON_SIZE, Qt::KeepAspectRatio, Qt::SmoothTransformation );
m_offlineIcon = m_offlineIcon.scaled( ICON_SIZE, ICON_SIZE, Qt::KeepAspectRatio, Qt::SmoothTransformation );
} }
void void
AccountFactoryWrapperDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const AccountFactoryWrapperDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const
{ {
@@ -98,23 +95,24 @@ AccountFactoryWrapperDelegate::paint(QPainter* painter, const QStyleOptionViewIt
QPixmap p; QPixmap p;
QString statusText; QString statusText;
Account::ConnectionState state = acc->connectionState(); Account::ConnectionState state = acc->connectionState();
const QRect connectIconRect( confRect.left() - PADDING - ICON_SIZE, topIcon, ICON_SIZE, ICON_SIZE );
if ( state == Account::Connected ) if ( state == Account::Connected )
{ {
p = m_onlineIcon; p = TomahawkUtils::defaultPixmap( TomahawkUtils::SipPluginOnline, TomahawkUtils::Original, connectIconRect.size() );
statusText = tr( "Online" ); statusText = tr( "Online" );
} }
else if ( state == Account::Connecting ) else if ( state == Account::Connecting )
{ {
p = m_offlineIcon; p = TomahawkUtils::defaultPixmap( TomahawkUtils::SipPluginOffline, TomahawkUtils::Original, connectIconRect.size() );
statusText = tr( "Connecting..." ); statusText = tr( "Connecting..." );
} }
else else
{ {
p = m_offlineIcon; p = TomahawkUtils::defaultPixmap( TomahawkUtils::SipPluginOffline, TomahawkUtils::Original, connectIconRect.size() );
statusText = tr( "Offline" ); statusText = tr( "Offline" );
} }
const QRect connectIconRect( confRect.left() - PADDING - ICON_SIZE, topIcon, ICON_SIZE, ICON_SIZE );
painter->drawPixmap( connectIconRect, p ); painter->drawPixmap( connectIconRect, p );
int width = painter->fontMetrics().width( statusText ); int width = painter->fontMetrics().width( statusText );

View File

@@ -49,7 +49,6 @@ signals:
void checkOrUncheck( const QModelIndex& row, Tomahawk::Accounts::Account* account, Qt::CheckState newState ); void checkOrUncheck( const QModelIndex& row, Tomahawk::Accounts::Account* account, Qt::CheckState newState );
private: private:
QPixmap m_removePixmap, m_offlineIcon, m_onlineIcon;
QModelIndex m_configPressed; QModelIndex m_configPressed;
mutable QHash< QPersistentModelIndex, QRect > m_cachedCheckRects; mutable QHash< QPersistentModelIndex, QRect > m_cachedCheckRects;

View File

@@ -21,7 +21,7 @@
#include "infosystem/InfoSystem.h" #include "infosystem/InfoSystem.h"
#include "LastFmInfoPlugin.h" #include "LastFmInfoPlugin.h"
#include "utils/TomahawkUtils.h" #include "utils/TomahawkUtilsGui.h"
#include "resolvers/QtScriptResolver.h" #include "resolvers/QtScriptResolver.h"
#include "AtticaManager.h" #include "AtticaManager.h"
#include "Pipeline.h" #include "Pipeline.h"
@@ -34,7 +34,6 @@ using namespace Accounts;
LastFmAccountFactory::LastFmAccountFactory() LastFmAccountFactory::LastFmAccountFactory()
{ {
m_icon.load( RESPATH "images/lastfm-icon.png" );
} }
@@ -48,7 +47,7 @@ LastFmAccountFactory::createAccount( const QString& accountId )
QPixmap QPixmap
LastFmAccountFactory::icon() const LastFmAccountFactory::icon() const
{ {
return m_icon; return TomahawkUtils::defaultPixmap( TomahawkUtils::LastfmIcon );
} }
@@ -56,7 +55,6 @@ LastFmAccount::LastFmAccount( const QString& accountId )
: CustomAtticaAccount( accountId ) : CustomAtticaAccount( accountId )
{ {
setAccountFriendlyName( "Last.Fm" ); setAccountFriendlyName( "Last.Fm" );
m_icon.load( RESPATH "images/lastfm-icon.png" );
AtticaManager::instance()->registerCustomAccount( "lastfm", this ); AtticaManager::instance()->registerCustomAccount( "lastfm", this );
@@ -152,14 +150,14 @@ LastFmAccount::configurationWidget()
Account::ConnectionState Account::ConnectionState
LastFmAccount::connectionState() const LastFmAccount::connectionState() const
{ {
return (!m_resolver.isNull() && m_resolver.data()->running()) ? Account::Connected : Account::Disconnected; return ( !m_resolver.isNull() && m_resolver.data()->running() ) ? Account::Connected : Account::Disconnected;
} }
QPixmap QPixmap
LastFmAccount::icon() const LastFmAccount::icon() const
{ {
return m_icon; return TomahawkUtils::defaultPixmap( TomahawkUtils::LastfmIcon );
} }

View File

@@ -28,14 +28,17 @@
#include <QObject> #include <QObject>
#include <QSet> #include <QSet>
namespace Tomahawk { namespace Tomahawk
class ExternalResolverGui; {
class ExternalResolverGui;
namespace InfoSystem { namespace InfoSystem
{
class LastFmInfoPlugin; class LastFmInfoPlugin;
} }
namespace Accounts { namespace Accounts
{
class LastFmConfig; class LastFmConfig;
@@ -53,9 +56,6 @@ public:
virtual bool allowUserCreation() const { return false; } virtual bool allowUserCreation() const { return false; }
virtual QPixmap icon() const; virtual QPixmap icon() const;
virtual bool isUnique() const { return true; } virtual bool isUnique() const { return true; }
private:
QPixmap m_icon;
}; };
/** /**
@@ -107,11 +107,10 @@ private:
QWeakPointer<Tomahawk::ExternalResolverGui> m_resolver; QWeakPointer<Tomahawk::ExternalResolverGui> m_resolver;
QWeakPointer<Tomahawk::InfoSystem::LastFmInfoPlugin> m_infoPlugin; QWeakPointer<Tomahawk::InfoSystem::LastFmInfoPlugin> m_infoPlugin;
QWeakPointer<LastFmConfig> m_configWidget; QWeakPointer<LastFmConfig> m_configWidget;
QPixmap m_icon;
}; };
} }
} }
#endif // LASTFMACCOUNT_H #endif // LASTFMACCOUNT_H

View File

@@ -20,7 +20,7 @@
<string/> <string/>
</property> </property>
<property name="pixmap"> <property name="pixmap">
<pixmap>:/data/images/lastfm-icon.png</pixmap> <pixmap>:/data/images/lastfm-icon.svg</pixmap>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>

View File

@@ -24,7 +24,7 @@
#include "SpotifyAccountConfig.h" #include "SpotifyAccountConfig.h"
#include "SpotifyPlaylistUpdater.h" #include "SpotifyPlaylistUpdater.h"
#include "resolvers/ScriptResolver.h" #include "resolvers/ScriptResolver.h"
#include "utils/TomahawkUtils.h" #include "utils/TomahawkUtilsGui.h"
#include "ActionCollection.h" #include "ActionCollection.h"
#include "Pipeline.h" #include "Pipeline.h"
#include "accounts/AccountManager.h" #include "accounts/AccountManager.h"
@@ -218,7 +218,7 @@ SpotifyAccount::hookupResolver()
// 0.4.x->0.5.x upgrade. So we do it manually for a while // 0.4.x->0.5.x upgrade. So we do it manually for a while
killExistingResolvers(); killExistingResolvers();
m_spotifyResolver = QWeakPointer< ScriptResolver >( qobject_cast< ScriptResolver* >( Pipeline::instance()->addScriptResolver( path ) ) ); m_spotifyResolver = QWeakPointer< ScriptResolver >( qobject_cast< ScriptResolver* >( Pipeline::instance()->addScriptResolver( path ) ) );
m_spotifyResolver.data()->setIcon( QPixmap( RESPATH "images/spotify-sourceicon.png" ) ); m_spotifyResolver.data()->setIcon( TomahawkUtils::defaultPixmap( TomahawkUtils::SpotifyIcon ) );
connect( m_spotifyResolver.data(), SIGNAL( changed() ), this, SLOT( resolverChanged() ) ); connect( m_spotifyResolver.data(), SIGNAL( changed() ), this, SLOT( resolverChanged() ) );
connect( m_spotifyResolver.data(), SIGNAL( customMessage( QString,QVariantMap ) ), this, SLOT( resolverMessage( QString, QVariantMap ) ) ); connect( m_spotifyResolver.data(), SIGNAL( customMessage( QString,QVariantMap ) ), this, SLOT( resolverMessage( QString, QVariantMap ) ) );

View File

@@ -20,13 +20,12 @@
#include "PipelineStatusItem.h" #include "PipelineStatusItem.h"
#include "utils/TomahawkUtils.h" #include "utils/TomahawkUtilsGui.h"
#include "Pipeline.h" #include "Pipeline.h"
#include "JobStatusModel.h" #include "JobStatusModel.h"
#include "JobStatusView.h" #include "JobStatusView.h"
#include "Source.h" #include "Source.h"
QPixmap* PipelineStatusItem::s_pixmap = 0;
PipelineStatusItem::PipelineStatusItem( const Tomahawk::query_ptr& q ) PipelineStatusItem::PipelineStatusItem( const Tomahawk::query_ptr& q )
: JobStatusItem() : JobStatusItem()
@@ -69,12 +68,7 @@ PipelineStatusItem::idle()
QPixmap QPixmap
PipelineStatusItem::icon() const PipelineStatusItem::icon() const
{ {
if ( !s_pixmap ) return TomahawkUtils::defaultPixmap( TomahawkUtils::Search );
{
s_pixmap = new QPixmap( RESPATH"images/search-icon.png" );
}
return *s_pixmap;
} }

View File

@@ -45,8 +45,6 @@ private slots:
private: private:
QString m_latestQuery; QString m_latestQuery;
static QPixmap* s_pixmap;
}; };
class PipelineStatusManager : public QObject class PipelineStatusManager : public QObject

View File

@@ -774,7 +774,7 @@ TrackView::description() const
QPixmap QPixmap
TrackView::pixmap() const TrackView::pixmap() const
{ {
return QPixmap( RESPATH "images/music-icon.png" ); return TomahawkUtils::defaultPixmap( TomahawkUtils::SuperCollection );
} }

View File

@@ -31,7 +31,7 @@
#include "database/Database.h" #include "database/Database.h"
#include "AlbumPlaylistInterface.h" #include "AlbumPlaylistInterface.h"
#include "PlayableItem.h" #include "PlayableItem.h"
#include "utils/TomahawkUtils.h" #include "utils/TomahawkUtilsGui.h"
#include "utils/Logger.h" #include "utils/Logger.h"
using namespace Tomahawk; using namespace Tomahawk;
@@ -41,7 +41,7 @@ TreeModel::TreeModel( QObject* parent )
: PlayableModel( parent ) : PlayableModel( parent )
, m_mode( DatabaseMode ) , m_mode( DatabaseMode )
{ {
setIcon( QPixmap( RESPATH "images/music-icon.png" ) ); setIcon( TomahawkUtils::defaultPixmap( TomahawkUtils::SuperCollection ) );
connect( AudioEngine::instance(), SIGNAL( started( Tomahawk::result_ptr ) ), SLOT( onPlaybackStarted( Tomahawk::result_ptr ) ), Qt::DirectConnection ); connect( AudioEngine::instance(), SIGNAL( started( Tomahawk::result_ptr ) ), SLOT( onPlaybackStarted( Tomahawk::result_ptr ) ), Qt::DirectConnection );
connect( AudioEngine::instance(), SIGNAL( stopped() ), SLOT( onPlaybackStopped() ), Qt::DirectConnection ); connect( AudioEngine::instance(), SIGNAL( stopped() ), SLOT( onPlaybackStopped() ), Qt::DirectConnection );

View File

@@ -520,7 +520,7 @@ DynamicWidget::pixmap() const
if ( m_playlist->mode() == OnDemand ) if ( m_playlist->mode() == OnDemand )
return TomahawkUtils::defaultPixmap( TomahawkUtils::Station ); return TomahawkUtils::defaultPixmap( TomahawkUtils::Station );
else if ( m_playlist->mode() == Static ) else if ( m_playlist->mode() == Static )
return QPixmap( RESPATH "images/automatic-playlist.png" ); return TomahawkUtils::defaultPixmap( TomahawkUtils::AutomaticPlaylist );
else else
return QPixmap(); return QPixmap();
} }

View File

@@ -30,13 +30,11 @@
#include "jobview/JobStatusModel.h" #include "jobview/JobStatusModel.h"
#include "jobview/JobStatusView.h" #include "jobview/JobStatusView.h"
#include "utils/NetworkReply.h" #include "utils/NetworkReply.h"
#include "utils/TomahawkUtils.h" #include "utils/TomahawkUtilsGui.h"
#include "utils/Logger.h" #include "utils/Logger.h"
using namespace Tomahawk; using namespace Tomahawk;
QPixmap* ShortenedLinkParser::s_pixmap = 0;
ShortenedLinkParser::ShortenedLinkParser ( const QStringList& urls, QObject* parent ) ShortenedLinkParser::ShortenedLinkParser ( const QStringList& urls, QObject* parent )
: QObject( parent ) : QObject( parent )
@@ -125,10 +123,7 @@ ShortenedLinkParser::checkFinished()
QPixmap QPixmap
ShortenedLinkParser::pixmap() ShortenedLinkParser::pixmap()
{ {
if ( !s_pixmap ) return TomahawkUtils::defaultPixmap( TomahawkUtils::Add );
s_pixmap = new QPixmap( RESPATH "images/add.png" );
return *s_pixmap;
} }
#endif #endif

View File

@@ -66,7 +66,6 @@ private:
#ifndef ENABLE_HEADLESS #ifndef ENABLE_HEADLESS
static QPixmap pixmap(); static QPixmap pixmap();
static QPixmap* s_pixmap;
#endif #endif
QStringList m_links; QStringList m_links;

View File

@@ -30,13 +30,11 @@
#include "jobview/JobStatusModel.h" #include "jobview/JobStatusModel.h"
#include "jobview/ErrorStatusMessage.h" #include "jobview/ErrorStatusMessage.h"
#include "utils/NetworkReply.h" #include "utils/NetworkReply.h"
#include "utils/TomahawkUtils.h" #include "utils/TomahawkUtilsGui.h"
#include "utils/Logger.h" #include "utils/Logger.h"
using namespace Tomahawk; using namespace Tomahawk;
QPixmap* SoundcloudParser::s_pixmap = 0;
SoundcloudParser::SoundcloudParser( const QStringList& Urls, bool createNewPlaylist, QObject* parent ) SoundcloudParser::SoundcloudParser( const QStringList& Urls, bool createNewPlaylist, QObject* parent )
: QObject ( parent ) : QObject ( parent )
@@ -236,8 +234,5 @@ SoundcloudParser::soundcloudBrowseFinished()
QPixmap QPixmap
SoundcloudParser::pixmap() const SoundcloudParser::pixmap() const
{ {
if ( !s_pixmap ) return TomahawkUtils::defaultPixmap( TomahawkUtils::SoundcloudIcon );
s_pixmap = new QPixmap( RESPATH "images/soundcloud.png" );
return *s_pixmap;
} }

View File

@@ -83,7 +83,6 @@ private:
Tomahawk::playlist_ptr m_playlist; Tomahawk::playlist_ptr m_playlist;
DropJobNotifier* m_browseJob; DropJobNotifier* m_browseJob;
DropJob::DropType m_type; DropJob::DropType m_type;
static QPixmap* s_pixmap;
}; };
} }

View File

@@ -94,14 +94,32 @@ namespace TomahawkUtils
LovedPlaylist, LovedPlaylist,
NewReleases, NewReleases,
NewAdditions, NewAdditions,
RecentlyPlayed,
AutomaticPlaylist,
Charts, Charts,
Station, Station,
Playlist, Playlist,
Search,
ListRemove, ListRemove,
ListAdd, ListAdd,
AdvancedSettings, AdvancedSettings,
AccountSettings, AccountSettings,
MusicSettings, MusicSettings,
Add,
DropSong,
DropAlbum,
DropAllSongs,
DropLocalSongs,
DropTopSongs,
LastfmIcon,
SpotifyIcon,
SoundcloudIcon,
AccountNone,
Starred,
Unstarred,
StarHovered,
SipPluginOnline,
SipPluginOffline,
Invalid Invalid
}; };

View File

@@ -433,7 +433,7 @@ defaultPixmap( ImageType type, ImageMode mode, const QSize& size )
if ( mode == Grid ) if ( mode == Grid )
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/artist-placeholder-grid.svg", size ); pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/artist-placeholder-grid.svg", size );
else else
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/artist-icon.png", size ); pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/artist-icon.svg", size );
break; break;
case DefaultTrackImage: case DefaultTrackImage:
@@ -582,11 +582,11 @@ defaultPixmap( ImageType type, ImageMode mode, const QSize& size )
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/headphones.svg", size ); pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/headphones.svg", size );
break; break;
case HeadphonesOff: case HeadphonesOff:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/headphones-off.png", size ); pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/headphones-off.svg", size );
break; break;
case PadlockClosed: case PadlockClosed:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/closed-padlock.png", size ); pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/closed-padlock.svg", size );
break; break;
case PadlockOpen: case PadlockOpen:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/open-padlock.svg", size ); pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/open-padlock.svg", size );
@@ -615,16 +615,28 @@ defaultPixmap( ImageType type, ImageMode mode, const QSize& size )
case NewAdditions: case NewAdditions:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/new-additions.svg", size ); pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/new-additions.svg", size );
break; break;
case RecentlyPlayed:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/recently-played.svg", size );
break;
case Charts: case Charts:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/charts.svg", size ); pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/charts.svg", size );
break; break;
case AutomaticPlaylist:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/automatic-playlist.svg", size );
break;
case Station: case Station:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/station.svg", size ); pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/station.svg", size );
break; break;
case Playlist: case Playlist:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/playlist-icon.svg", size ); pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/playlist-icon.svg", size );
break; break;
case Search:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/search-icon.svg", size );
break;
case Add:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/add.svg", size );
break;
case ListAdd: case ListAdd:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/list-add.svg", size ); pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/list-add.svg", size );
break; break;
@@ -642,6 +654,52 @@ defaultPixmap( ImageType type, ImageMode mode, const QSize& size )
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/music-settings.svg", size ); pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/music-settings.svg", size );
break; break;
case DropSong:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/drop-song.svg", size );
break;
case DropAlbum:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/drop-album.svg", size );
break;
case DropAllSongs:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/drop-all-songs.svg", size );
break;
case DropLocalSongs:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/drop-local-songs.svg", size );
break;
case DropTopSongs:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/drop-top-songs.svg", size );
break;
case Starred:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/starred.svg", size );
break;
case Unstarred:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/star-unstarred.svg", size );
break;
case StarHovered:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/star-hover.svg", size );
break;
case SipPluginOnline:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/sipplugin-online.svg", size );
break;
case SipPluginOffline:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/sipplugin-offline.svg", size );
break;
case AccountNone:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/account-none.svg", size );
break;
case LastfmIcon:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/lastfm-icon.svg", size );
break;
case SpotifyIcon:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/spotify-sourceicon.svg", size );
break;
case SoundcloudIcon:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/soundcloud.svg", size );
break;
default: default:
break; break;
} }

View File

@@ -213,3 +213,10 @@ SearchWidget::sortAlbums()
m_albumsModel->clear(); m_albumsModel->clear();
m_albumsModel->appendAlbums( sortedAlbums ); m_albumsModel->appendAlbums( sortedAlbums );
} }
QPixmap
SearchWidget::pixmap() const
{
return TomahawkUtils::defaultPixmap( TomahawkUtils::Search );
}

View File

@@ -52,7 +52,7 @@ public:
virtual QString title() const { return QString( tr( "Search: %1" ) ).arg( m_search ); } virtual QString title() const { return QString( tr( "Search: %1" ) ).arg( m_search ); }
virtual QString description() const { return tr( "Results for '%1'" ).arg( m_search ); } virtual QString description() const { return tr( "Results for '%1'" ).arg( m_search ); }
virtual QPixmap pixmap() const { return QPixmap( RESPATH "images/search-icon.png" ); } virtual QPixmap pixmap() const;
virtual bool isTemporaryPage() const { return true; } virtual bool isTemporaryPage() const { return true; }

View File

@@ -310,7 +310,7 @@ PlaylistDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
if ( type == RecentlyPlayedPlaylistsModel::StaticPlaylist ) if ( type == RecentlyPlayedPlaylistsModel::StaticPlaylist )
icon = TomahawkUtils::defaultPixmap( TomahawkUtils::Playlist, TomahawkUtils::Original, pixmapRect.size() ); icon = TomahawkUtils::defaultPixmap( TomahawkUtils::Playlist, TomahawkUtils::Original, pixmapRect.size() );
else if ( type == RecentlyPlayedPlaylistsModel::AutoPlaylist ) else if ( type == RecentlyPlayedPlaylistsModel::AutoPlaylist )
icon = m_autoIcon; icon = TomahawkUtils::defaultPixmap( TomahawkUtils::AutomaticPlaylist, TomahawkUtils::Original, pixmapRect.size() );
else if ( type == RecentlyPlayedPlaylistsModel::Station ) else if ( type == RecentlyPlayedPlaylistsModel::Station )
icon = TomahawkUtils::defaultPixmap( TomahawkUtils::Station, TomahawkUtils::Original, pixmapRect.size() ); icon = TomahawkUtils::defaultPixmap( TomahawkUtils::Station, TomahawkUtils::Original, pixmapRect.size() );

View File

@@ -51,15 +51,11 @@ Q_OBJECT
public: public:
PlaylistDelegate() PlaylistDelegate()
{ {
m_autoIcon = QPixmap( RESPATH "images/automatic-playlist.png" );
} }
protected: protected:
void paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const; void paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const;
QSize sizeHint( const QStyleOptionViewItem& option, const QModelIndex& index ) const; QSize sizeHint( const QStyleOptionViewItem& option, const QModelIndex& index ) const;
private:
QPixmap m_autoIcon;
}; };

View File

@@ -60,12 +60,6 @@ SourceDelegate::SourceDelegate( QAbstractItemView* parent )
m_dropTypeTextMap.insert( 3, tr( "Local" ) ); m_dropTypeTextMap.insert( 3, tr( "Local" ) );
m_dropTypeTextMap.insert( 4, tr( "Top 10" ) ); m_dropTypeTextMap.insert( 4, tr( "Top 10" ) );
m_dropTypeImageMap.insert( 0, QPixmap( RESPATH "images/drop-song.png" ).scaledToWidth( 32, Qt::SmoothTransformation ) );
m_dropTypeImageMap.insert( 1, QPixmap( RESPATH "images/drop-album.png" ).scaledToWidth( 32, Qt::SmoothTransformation ) );
m_dropTypeImageMap.insert( 2, QPixmap( RESPATH "images/drop-all-songs.png" ).scaledToHeight( 32, Qt::SmoothTransformation ) );
m_dropTypeImageMap.insert( 3, QPixmap( RESPATH "images/drop-local-songs.png" ).scaledToWidth( 32, Qt::SmoothTransformation ) );
m_dropTypeImageMap.insert( 4, QPixmap( RESPATH "images/drop-top-songs.png" ).scaledToWidth( 32, Qt::SmoothTransformation ) );
m_dropMimeData = new QMimeData(); m_dropMimeData = new QMimeData();
} }
@@ -516,7 +510,28 @@ SourceDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, co
if ( itemsRect.bottom() - textRect.height() - 2 > itemsRect.top() ) if ( itemsRect.bottom() - textRect.height() - 2 > itemsRect.top() )
{ {
imageRect = itemsRect.adjusted( iconSpacing, verticalOffset, -iconSpacing, -textRect.height() - 2 ); imageRect = itemsRect.adjusted( iconSpacing, verticalOffset, -iconSpacing, -textRect.height() - 2 );
painter->drawPixmap( imageRect.x(), imageRect.y(), m_dropTypeImageMap.value( i ).copy( 0, 32 - imageRect.height(), 32, imageRect.height() ) );
QPixmap pixmap;
switch ( i )
{
case 0:
pixmap = TomahawkUtils::defaultPixmap( TomahawkUtils::DropSong, TomahawkUtils::Original, imageRect.size() );
break;
case 1:
pixmap = TomahawkUtils::defaultPixmap( TomahawkUtils::DropAlbum, TomahawkUtils::Original, imageRect.size() );
break;
case 2:
pixmap = TomahawkUtils::defaultPixmap( TomahawkUtils::DropAllSongs, TomahawkUtils::Original, imageRect.size() );
break;
case 3:
pixmap = TomahawkUtils::defaultPixmap( TomahawkUtils::DropLocalSongs, TomahawkUtils::Original, imageRect.size() );
break;
case 4:
pixmap = TomahawkUtils::defaultPixmap( TomahawkUtils::DropTopSongs, TomahawkUtils::Original, imageRect.size() );
break;
}
painter->drawPixmap( imageRect, pixmap );
} }
count++; count++;

View File

@@ -75,7 +75,6 @@ private:
qint64 m_lastClicked; qint64 m_lastClicked;
QMap< int, SourceTreeItem::DropType > m_dropTypeMap; QMap< int, SourceTreeItem::DropType > m_dropTypeMap;
QMap< int, QString > m_dropTypeTextMap; QMap< int, QString > m_dropTypeTextMap;
QMap< int, QPixmap > m_dropTypeImageMap;
mutable QPersistentModelIndex m_trackHovered; mutable QPersistentModelIndex m_trackHovered;
mutable QHash< QPersistentModelIndex, QRect > m_trackRects; mutable QHash< QPersistentModelIndex, QRect > m_trackRects;

View File

@@ -297,7 +297,7 @@ SourcesModel::appendGroups()
LovedTracksItem* loved = new LovedTracksItem( this, browse ); LovedTracksItem* loved = new LovedTracksItem( this, browse );
loved->setSortValue( 2 ); loved->setSortValue( 2 );
GenericPageItem* recent = new GenericPageItem( this, browse, tr( "Recently Played" ), QIcon( RESPATH "images/recently-played.png" ), GenericPageItem* recent = new GenericPageItem( this, browse, tr( "Recently Played" ), ImageRegistry::instance()->icon( RESPATH "images/recently-played.svg" ),
boost::bind( &ViewManager::showRecentPlaysPage, ViewManager::instance() ), boost::bind( &ViewManager::showRecentPlaysPage, ViewManager::instance() ),
boost::bind( &ViewManager::recentPlaysWidget, ViewManager::instance() ) ); boost::bind( &ViewManager::recentPlaysWidget, ViewManager::instance() ) );
recent->setSortValue( 3 ); recent->setSortValue( 3 );

View File

@@ -19,22 +19,22 @@
#include "CategoryItems.h" #include "CategoryItems.h"
#include <QMimeData>
#include <echonest/Playlist.h>
#include "DropJob.h"
#include "TomahawkApp.h" #include "TomahawkApp.h"
#include "ViewManager.h" #include "ViewManager.h"
#include "ViewPage.h" #include "ViewPage.h"
#include "SourceList.h" #include "SourceList.h"
#include "SourceTreeView.h" #include "SourceTreeView.h"
#include "utils/TomahawkUtils.h"
#include "widgets/NewPlaylistWidget.h"
#include "TomahawkWindow.h" #include "TomahawkWindow.h"
#include "utils/TomahawkUtils.h"
#include "playlist/dynamic/GeneratorInterface.h" #include "playlist/dynamic/GeneratorInterface.h"
#include "widgets/NewPlaylistWidget.h"
#include "utils/ImageRegistry.h"
#include "utils/Logger.h" #include "utils/Logger.h"
#include "DropJob.h"
#include <echonest/Playlist.h>
#include <QMimeData>
using namespace Tomahawk; using namespace Tomahawk;
@@ -45,7 +45,6 @@ CategoryAddItem::CategoryAddItem( SourcesModel* model, SourceTreeItem* parent, S
: SourceTreeItem( model, parent, SourcesModel::CategoryAdd ) : SourceTreeItem( model, parent, SourcesModel::CategoryAdd )
, m_categoryType( type ) , m_categoryType( type )
{ {
m_icon = QIcon( RESPATH "images/add.png" );
} }
@@ -107,7 +106,7 @@ CategoryAddItem::flags() const
QIcon QIcon
CategoryAddItem::icon() const CategoryAddItem::icon() const
{ {
return m_icon; return ImageRegistry::instance()->icon( RESPATH "images/add.svg" );
} }

View File

@@ -46,8 +46,6 @@ private slots:
private: private:
SourcesModel::CategoryType m_categoryType; SourcesModel::CategoryType m_categoryType;
QIcon m_icon;
}; };
class CategoryItem : public SourceTreeItem class CategoryItem : public SourceTreeItem

View File

@@ -448,8 +448,6 @@ DynamicPlaylistItem::DynamicPlaylistItem( SourcesModel* mdl, SourceTreeItem* par
connect( pl.data(), SIGNAL( dynamicRevisionLoaded( Tomahawk::DynamicPlaylistRevision ) ), connect( pl.data(), SIGNAL( dynamicRevisionLoaded( Tomahawk::DynamicPlaylistRevision ) ),
SLOT( onDynamicPlaylistLoaded( Tomahawk::DynamicPlaylistRevision ) ), Qt::QueuedConnection ); SLOT( onDynamicPlaylistLoaded( Tomahawk::DynamicPlaylistRevision ) ), Qt::QueuedConnection );
m_automaticPlaylistIcon = QIcon( RESPATH "images/automatic-playlist.png" );
if ( ViewManager::instance()->pageForDynPlaylist( pl ) ) if ( ViewManager::instance()->pageForDynPlaylist( pl ) )
model()->linkSourceItemToPage( this, ViewManager::instance()->pageForDynPlaylist( pl ) ); model()->linkSourceItemToPage( this, ViewManager::instance()->pageForDynPlaylist( pl ) );
} }
@@ -576,11 +574,11 @@ DynamicPlaylistItem::icon() const
{ {
if ( m_dynplaylist->mode() == OnDemand ) if ( m_dynplaylist->mode() == OnDemand )
{ {
return TomahawkUtils::defaultPixmap( TomahawkUtils::Station, TomahawkUtils::Original ); return TomahawkUtils::defaultPixmap( TomahawkUtils::Station );
} }
else else
{ {
return m_automaticPlaylistIcon; return TomahawkUtils::defaultPixmap( TomahawkUtils::AutomaticPlaylist );
} }
} }

View File

@@ -99,8 +99,6 @@ private:
void checkReparentHackNeeded( const Tomahawk::DynamicPlaylistRevision& rev ); void checkReparentHackNeeded( const Tomahawk::DynamicPlaylistRevision& rev );
Tomahawk::dynplaylist_ptr m_dynplaylist; Tomahawk::dynplaylist_ptr m_dynplaylist;
QIcon m_automaticPlaylistIcon;
}; };

View File

@@ -73,7 +73,7 @@ SourceItem::SourceItem( SourcesModel* mdl, SourceTreeItem* parent, const Tomahaw
boost::bind( &SourceItem::latestAdditionsClicked, this ), boost::bind( &SourceItem::latestAdditionsClicked, this ),
boost::bind( &SourceItem::getLatestAdditionsPage, this ) ); boost::bind( &SourceItem::getLatestAdditionsPage, this ) );
m_recentPlaysItem = new GenericPageItem( model(), this, tr( "Recently Played" ), QIcon( RESPATH "images/recently-played.png" ), m_recentPlaysItem = new GenericPageItem( model(), this, tr( "Recently Played" ), ImageRegistry::instance()->icon( RESPATH "images/recently-played.svg" ),
boost::bind( &SourceItem::recentPlaysClicked, this ), boost::bind( &SourceItem::recentPlaysClicked, this ),
boost::bind( &SourceItem::getRecentPlaysPage, this ) ); boost::bind( &SourceItem::getRecentPlaysPage, this ) );
@@ -559,7 +559,7 @@ SourceItem::recentPlaysClicked()
if ( !m_recentPlaysPage ) if ( !m_recentPlaysPage )
{ {
FlexibleView* pv = new FlexibleView( ViewManager::instance()->widget() ); FlexibleView* pv = new FlexibleView( ViewManager::instance()->widget() );
pv->setPixmap( QPixmap( RESPATH "images/recently-played.png" ) ); pv->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::RecentlyPlayed ) );
RecentlyPlayedModel* raModel = new RecentlyPlayedModel( pv ); RecentlyPlayedModel* raModel = new RecentlyPlayedModel( pv );
raModel->setTitle( tr( "Recently Played Tracks" ) ); raModel->setTitle( tr( "Recently Played Tracks" ) );

View File

@@ -70,7 +70,7 @@ TemporaryPageItem::TemporaryPageItem ( SourcesModel* mdl, SourceTreeItem* parent
} }
else if ( dynamic_cast< SearchWidget* >( page ) ) else if ( dynamic_cast< SearchWidget* >( page ) )
{ {
m_icon = QIcon( RESPATH "images/search-icon.png" ); m_icon = ImageRegistry::instance()->icon( RESPATH "images/search-icon.svg" );
} }
if ( action ) if ( action )

View File

@@ -21,11 +21,13 @@
#include "accounts/AccountModel.h" #include "accounts/AccountModel.h"
#include "accounts/AccountManager.h" #include "accounts/AccountManager.h"
#include "AccountWidget.h" #include "AccountWidget.h"
#include "utils/ImageRegistry.h"
#include "utils/TomahawkUtilsGui.h" #include "utils/TomahawkUtilsGui.h"
#include "utils/Logger.h"
#include <QDebug>
#include <QPushButton> #include <QPushButton>
AccountListWidget::AccountListWidget( AccountModelFactoryProxy* model, QWidget* parent ) AccountListWidget::AccountListWidget( AccountModelFactoryProxy* model, QWidget* parent )
: QWidget( parent ) : QWidget( parent )
, m_model( model ) , m_model( model )
@@ -227,6 +229,7 @@ AccountListWidget::updateToggleOnlineStateButton()
m_toggleOnlineButton->setText( m_toggleOnlineButtonState ? tr( "Disconnect &All" ) m_toggleOnlineButton->setText( m_toggleOnlineButtonState ? tr( "Disconnect &All" )
: tr( "Connect &All" ) ); : tr( "Connect &All" ) );
m_toggleOnlineButton->setIcon( m_toggleOnlineButtonState ? QIcon( RESPATH "images/account-online.png" ) m_toggleOnlineButton->setIcon( m_toggleOnlineButtonState ?
: QIcon( RESPATH "images/account-offline.png" ) ); ImageRegistry::instance()->icon( RESPATH "images/account-online.svg" ) :
ImageRegistry::instance()->icon( RESPATH "images/account-offline.svg" ) );
} }

View File

@@ -94,9 +94,6 @@ AccountsToolButton::AccountsToolButton( QWidget* parent )
bottomLayout->addWidget( settingsButton ); bottomLayout->addWidget( settingsButton );
wMainLayout->addLayout( bottomLayout ); wMainLayout->addLayout( bottomLayout );
//ToolButton stuff
m_defaultPixmap = QPixmap( RESPATH "images/account-none.png" ).scaled( iconSize(), Qt::KeepAspectRatio, Qt::SmoothTransformation );
connect( m_proxy, SIGNAL( dataChanged( QModelIndex, QModelIndex ) ), connect( m_proxy, SIGNAL( dataChanged( QModelIndex, QModelIndex ) ),
this, SLOT( updateIcons() ) ); this, SLOT( updateIcons() ) );
connect( m_proxy, SIGNAL( rowsInserted ( QModelIndex, int, int ) ), connect( m_proxy, SIGNAL( rowsInserted ( QModelIndex, int, int ) ),
@@ -137,7 +134,8 @@ AccountsToolButton::paintEvent( QPaintEvent* event )
QRect pixmapRect( QPoint( width() / 2 - iconSize().width() / 2, QRect pixmapRect( QPoint( width() / 2 - iconSize().width() / 2,
height() / 2 - iconSize().height() / 2 ), height() / 2 - iconSize().height() / 2 ),
iconSize() ); iconSize() );
painter.drawPixmap( pixmapRect, m_defaultPixmap );
painter.drawPixmap( pixmapRect, TomahawkUtils::defaultPixmap( TomahawkUtils::AccountNone, TomahawkUtils::Original, iconSize() ) );
} }
else else
{ {

View File

@@ -51,7 +51,6 @@ private:
Tomahawk::Accounts::AccountModel *m_model; Tomahawk::Accounts::AccountModel *m_model;
AccountModelFactoryProxy *m_proxy; AccountModelFactoryProxy *m_proxy;
QPixmap m_defaultPixmap;
QList< QPixmap > m_factoryPixmaps; QList< QPixmap > m_factoryPixmaps;
}; };