1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-28 03:32:27 +01:00

* Elide temporary page's text when showing the delete button.

This commit is contained in:
Christian Muehlhaeuser 2012-06-26 05:16:00 +02:00
parent f303fcbebc
commit 7efaa62038

View File

@ -526,8 +526,6 @@ SourceDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, co
if ( !index.parent().parent().isValid() )
o.rect.adjust( 7, 0, 0, 0 );
QStyledItemDelegate::paint( painter, o, index );
if ( type == SourcesModel::TemporaryPage )
{
TemporaryPageItem* gpi = qobject_cast< TemporaryPageItem* >( item );
@ -535,16 +533,24 @@ SourceDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, co
if ( gpi && o3.state & QStyle::State_MouseOver )
{
// draw close icon
int padding = 3;
m_iconHeight = ( o3.rect.height() - 2 * padding );
o.rect.adjust( 0, 0, -( padding + m_iconHeight ), 0 );
QStyledItemDelegate::paint( painter, o, index );
// draw close icon
QPixmap p( RESPATH "images/list-remove.png" );
p = p.scaledToHeight( m_iconHeight, Qt::SmoothTransformation );
QRect r( o3.rect.right() - padding - m_iconHeight, padding + o3.rect.y(), m_iconHeight, m_iconHeight );
painter->drawPixmap( r, p );
}
else
QStyledItemDelegate::paint( painter, o, index );
}
else
QStyledItemDelegate::paint( painter, o, index );
}
paintDecorations( painter, o3, index );