mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-04 21:27:58 +02:00
* Hotfixes for non-KDE users.
This commit is contained in:
@@ -271,6 +271,9 @@ PlaylistDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
|
|||||||
boldFont.setBold( true );
|
boldFont.setBold( true );
|
||||||
boldFont.setPixelSize( 11 );
|
boldFont.setPixelSize( 11 );
|
||||||
|
|
||||||
|
QFont figFont = boldFont;
|
||||||
|
figFont.setPixelSize( 10 );
|
||||||
|
|
||||||
QPixmap icon;
|
QPixmap icon;
|
||||||
RecentlyPlayedPlaylistsModel::PlaylistTypes type = (RecentlyPlayedPlaylistsModel::PlaylistTypes)index.data( RecentlyPlayedPlaylistsModel::PlaylistTypeRole ).toInt();
|
RecentlyPlayedPlaylistsModel::PlaylistTypes type = (RecentlyPlayedPlaylistsModel::PlaylistTypes)index.data( RecentlyPlayedPlaylistsModel::PlaylistTypeRole ).toInt();
|
||||||
if( type == RecentlyPlayedPlaylistsModel::StaticPlaylist )
|
if( type == RecentlyPlayedPlaylistsModel::StaticPlaylist )
|
||||||
@@ -288,6 +291,7 @@ PlaylistDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
|
|||||||
if ( type != RecentlyPlayedPlaylistsModel::Station )
|
if ( type != RecentlyPlayedPlaylistsModel::Station )
|
||||||
{
|
{
|
||||||
painter->save();
|
painter->save();
|
||||||
|
painter->setFont( figFont );
|
||||||
QString tracks = index.data( RecentlyPlayedPlaylistsModel::TrackCountRole ).toString();
|
QString tracks = index.data( RecentlyPlayedPlaylistsModel::TrackCountRole ).toString();
|
||||||
int width = painter->fontMetrics().width( tracks );
|
int width = painter->fontMetrics().width( tracks );
|
||||||
// int bottomEdge = pixmapRect
|
// int bottomEdge = pixmapRect
|
||||||
@@ -301,7 +305,6 @@ PlaylistDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
|
|||||||
QColor figColor( 153, 153, 153 );
|
QColor figColor( 153, 153, 153 );
|
||||||
painter->setPen( figColor );
|
painter->setPen( figColor );
|
||||||
painter->setBrush( figColor );
|
painter->setBrush( figColor );
|
||||||
painter->setFont( boldFont );
|
|
||||||
|
|
||||||
TomahawkUtils::drawBackgroundAndNumbers( painter, tracks, rect );
|
TomahawkUtils::drawBackgroundAndNumbers( painter, tracks, rect );
|
||||||
painter->restore();
|
painter->restore();
|
||||||
@@ -318,7 +321,7 @@ PlaylistDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
|
|||||||
if ( author.contains( "@" ) )
|
if ( author.contains( "@" ) )
|
||||||
author = author.mid( 0, author.indexOf( '@' ) );
|
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() );
|
QRect avatarNameRect( opt.rect.width() - 10 - w, r.bottom(), w, opt.rect.bottom() - r.bottom() );
|
||||||
painter->drawText( avatarNameRect, author, QTextOption( Qt::AlignCenter ) );
|
painter->drawText( avatarNameRect, author, QTextOption( Qt::AlignCenter ) );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user