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:
@@ -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();
|
||||||
|
@@ -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
|
||||||
|
Reference in New Issue
Block a user