1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-18 23:09:42 +01:00

* Hotfixes for non-KDE users.

This commit is contained in:
Christian Muehlhaeuser 2012-01-06 08:08:34 +01:00
parent dc79dfe403
commit c0c43441c1

View File

@ -271,6 +271,9 @@ PlaylistDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
boldFont.setBold( true );
boldFont.setPixelSize( 11 );
QFont figFont = boldFont;
figFont.setPixelSize( 10 );
QPixmap icon;
RecentlyPlayedPlaylistsModel::PlaylistTypes type = (RecentlyPlayedPlaylistsModel::PlaylistTypes)index.data( RecentlyPlayedPlaylistsModel::PlaylistTypeRole ).toInt();
if( type == RecentlyPlayedPlaylistsModel::StaticPlaylist )
@ -288,6 +291,7 @@ PlaylistDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
if ( type != RecentlyPlayedPlaylistsModel::Station )
{
painter->save();
painter->setFont( figFont );
QString tracks = index.data( RecentlyPlayedPlaylistsModel::TrackCountRole ).toString();
int width = painter->fontMetrics().width( tracks );
// int bottomEdge = pixmapRect
@ -301,7 +305,6 @@ PlaylistDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
QColor figColor( 153, 153, 153 );
painter->setPen( figColor );
painter->setBrush( figColor );
painter->setFont( boldFont );
TomahawkUtils::drawBackgroundAndNumbers( painter, tracks, rect );
painter->restore();
@ -318,7 +321,7 @@ PlaylistDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
if ( author.contains( "@" ) )
author = author.mid( 0, author.indexOf( '@' ) );
const int w = painter->fontMetrics().width( author );
const int w = painter->fontMetrics().width( author ) + 2;
QRect avatarNameRect( opt.rect.width() - 10 - w, r.bottom(), w, opt.rect.bottom() - r.bottom() );
painter->drawText( avatarNameRect, author, QTextOption( Qt::AlignCenter ) );