From e0b31b037aecd9683abacf60761b97363e2ce561 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Sun, 20 Jan 2013 06:43:35 +0100 Subject: [PATCH] * Fixed now playing icon being squeezed in Charts delegate. --- .../playlist/PlaylistChartItemDelegate.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/libtomahawk/playlist/PlaylistChartItemDelegate.cpp b/src/libtomahawk/playlist/PlaylistChartItemDelegate.cpp index eba7c3b97..66f0082ea 100644 --- a/src/libtomahawk/playlist/PlaylistChartItemDelegate.cpp +++ b/src/libtomahawk/playlist/PlaylistChartItemDelegate.cpp @@ -142,16 +142,16 @@ PlaylistChartItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& 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 if ( item->isPlaying() ) { - QPixmap nowPlayingIcon = TomahawkUtils::defaultPixmap( TomahawkUtils::NowPlayingSpeaker ); - QRect npr = r.adjusted( 3, r.height() / 2 - nowPlayingIcon.height() / 2, 18 - r.width(), -r.height() / 2 + nowPlayingIcon.height() / 2 ); - nowPlayingIcon = TomahawkUtils::defaultPixmap( TomahawkUtils::NowPlayingSpeaker, TomahawkUtils::Original, npr.size() ); - painter->drawPixmap( npr, nowPlayingIcon ); - r.adjust( 22, 0, 0, 0 ); + const int pixMargin = 4; + const int pixHeight = r.height() - pixMargin * 2; + QRect npr = r.adjusted( pixMargin, pixMargin + 1, pixHeight - r.width() + pixMargin, -pixMargin + 1 ); + painter->drawPixmap( npr, TomahawkUtils::defaultPixmap( TomahawkUtils::NowPlayingSpeaker, TomahawkUtils::Original, npr.size() ) ); + r.adjust( pixHeight + 8, 0, 0, 0 ); } QFont figureFont = opt.font;