mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-18 23:09:42 +01:00
elide and tooltip
This commit is contained in:
parent
75ea38010f
commit
9adc4be099
@ -295,6 +295,7 @@ AccountDelegate::paint ( QPainter* painter, const QStyleOptionViewItem& option,
|
||||
const int descWidth = rightEdge - leftTitleEdge - PADDING;
|
||||
painter->setFont( descFont );
|
||||
const QRect descRect( leftTitleEdge, runningBottom + PADDING, descWidth, painter->fontMetrics().height() );
|
||||
desc = painter->fontMetrics().elidedText( desc, Qt::ElideRight, descWidth );
|
||||
painter->drawText( descRect, Qt::AlignLeft | Qt::TextWordWrap | Qt::AlignTop, desc );
|
||||
runningBottom = descRect.bottom();
|
||||
|
||||
|
@ -108,6 +108,7 @@ AccountModel::data( const QModelIndex& index, int role ) const
|
||||
return fac->icon();
|
||||
case StateRole:
|
||||
return ShippedWithTomahawk;
|
||||
case Qt::ToolTipRole:
|
||||
case DescriptionRole:
|
||||
return fac->description();
|
||||
case CanRateRole:
|
||||
@ -160,6 +161,7 @@ AccountModel::data( const QModelIndex& index, int role ) const
|
||||
return QVariant::fromValue< QPixmap >( AtticaManager::instance()->iconForResolver( c ) );
|
||||
case StateRole:
|
||||
return (int)AtticaManager::instance()->resolverState( c );
|
||||
case Qt::ToolTipRole:
|
||||
case DescriptionRole:
|
||||
return c.description();
|
||||
case AuthorRole:
|
||||
@ -235,6 +237,7 @@ AccountModel::data( const QModelIndex& index, int role ) const
|
||||
return node->factory->prettyName();
|
||||
case Qt::DecorationRole:
|
||||
return node->factory->icon();
|
||||
case Qt::ToolTipRole:
|
||||
case DescriptionRole:
|
||||
return node->factory->description();
|
||||
case StateRole:
|
||||
|
Loading…
x
Reference in New Issue
Block a user