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