1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-25 15:01:11 +02:00

* BasicHeader can tint its pixmaps.

This commit is contained in:
Christian Muehlhaeuser
2014-09-02 05:58:30 +02:00
parent 0998a69c59
commit 252ef64a3d
2 changed files with 7 additions and 3 deletions

View File

@@ -99,10 +99,14 @@ BasicHeader::setDescription( const QString& /* s */ )
void void
BasicHeader::setPixmap( const QPixmap& p ) BasicHeader::setPixmap( const QPixmap& pixmap, bool tinted )
{ {
ui->iconLabel->setFixedHeight( 20 ); ui->iconLabel->setFixedHeight( 20 );
ui->iconLabel->setPixmap( TomahawkUtils::tinted( p, Qt::white ).scaledToHeight( ui->iconLabel->height(), Qt::SmoothTransformation ) );
QPixmap p = pixmap;
if ( tinted )
p = TomahawkUtils::tinted( p, Qt::white );
ui->iconLabel->setPixmap( p.scaledToHeight( ui->iconLabel->height(), Qt::SmoothTransformation ) );
if ( !p.isNull() ) if ( !p.isNull() )
ui->iconLabel->show(); ui->iconLabel->show();

View File

@@ -42,7 +42,7 @@ public:
public slots: public slots:
virtual void setCaption( const QString& s ); virtual void setCaption( const QString& s );
virtual void setDescription( const QString& s ); virtual void setDescription( const QString& s );
virtual void setPixmap( const QPixmap& p ); virtual void setPixmap( const QPixmap& p, bool tinted = true );
}; };
#endif // BASICHEADER_H #endif // BASICHEADER_H