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

* Show now playing speaker next to current playlist again.

This commit is contained in:
Christian Muehlhaeuser
2012-02-24 05:18:55 +01:00
parent a04d384ac4
commit b2fc0935a4

View File

@@ -132,7 +132,7 @@ SourceDelegate::paintDecorations( QPainter* painter, const QStyleOptionViewItem&
if ( playable && playing && item->isBeingPlayed() ) if ( playable && playing && item->isBeingPlayed() )
{ {
const int iconW = option.rect.height() - 4; const int iconW = option.rect.height() - 4;
QRect iconRect = QRect( option.rect.x() - iconW - 4, option.rect.y() + 2, iconW, iconW ); QRect iconRect = QRect( 4, option.rect.y() + 2, iconW, iconW );
QPixmap speaker = option.state & QStyle::State_Selected ? m_nowPlayingSpeaker : m_nowPlayingSpeakerDark; QPixmap speaker = option.state & QStyle::State_Selected ? m_nowPlayingSpeaker : m_nowPlayingSpeakerDark;
speaker = speaker.scaledToHeight( iconW, Qt::SmoothTransformation ); speaker = speaker.scaledToHeight( iconW, Qt::SmoothTransformation );
painter->drawPixmap( iconRect, speaker ); painter->drawPixmap( iconRect, speaker );
@@ -406,8 +406,6 @@ SourceDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, co
if ( type != SourcesModel::Group && type != SourcesModel::Category && type != SourcesModel::Divider ) if ( type != SourcesModel::Group && type != SourcesModel::Category && type != SourcesModel::Divider )
QApplication::style()->drawControl( QStyle::CE_ItemViewItem, &o3, painter ); QApplication::style()->drawControl( QStyle::CE_ItemViewItem, &o3, painter );
paintDecorations( painter, o3, index );
if ( type == SourcesModel::Collection ) if ( type == SourcesModel::Collection )
{ {
paintCollection( painter, o, index ); paintCollection( painter, o, index );
@@ -538,6 +536,8 @@ SourceDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, co
} }
} }
paintDecorations( painter, o3, index );
painter->restore(); painter->restore();
} }