1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-07 14:46:33 +02:00

* Fixed now playing icon being squeezed in Charts delegate.

This commit is contained in:
Christian Muehlhaeuser
2013-01-20 06:43:35 +01:00
parent 60239668a7
commit e0b31b037a

View File

@@ -142,16 +142,16 @@ PlaylistChartItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem&
painter->save(); painter->save();
{ {
QRect r = opt.rect.adjusted( 3, 6, 0, -6 ); QRect r = opt.rect.adjusted( 4, 6, 0, -6 );
// Paint Now Playing Speaker Icon // Paint Now Playing Speaker Icon
if ( item->isPlaying() ) if ( item->isPlaying() )
{ {
QPixmap nowPlayingIcon = TomahawkUtils::defaultPixmap( TomahawkUtils::NowPlayingSpeaker ); const int pixMargin = 4;
QRect npr = r.adjusted( 3, r.height() / 2 - nowPlayingIcon.height() / 2, 18 - r.width(), -r.height() / 2 + nowPlayingIcon.height() / 2 ); const int pixHeight = r.height() - pixMargin * 2;
nowPlayingIcon = TomahawkUtils::defaultPixmap( TomahawkUtils::NowPlayingSpeaker, TomahawkUtils::Original, npr.size() ); QRect npr = r.adjusted( pixMargin, pixMargin + 1, pixHeight - r.width() + pixMargin, -pixMargin + 1 );
painter->drawPixmap( npr, nowPlayingIcon ); painter->drawPixmap( npr, TomahawkUtils::defaultPixmap( TomahawkUtils::NowPlayingSpeaker, TomahawkUtils::Original, npr.size() ) );
r.adjust( 22, 0, 0, 0 ); r.adjust( pixHeight + 8, 0, 0, 0 );
} }
QFont figureFont = opt.font; QFont figureFont = opt.font;