mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
* Don't show an info button for empty items.
This commit is contained in:
@@ -227,7 +227,7 @@ PlaylistItemDelegate::paintDetailed( QPainter* painter, const QStyleOptionViewIt
|
|||||||
opt.text.clear();
|
opt.text.clear();
|
||||||
qApp->style()->drawControl( QStyle::CE_ItemViewItem, &opt, painter );
|
qApp->style()->drawControl( QStyle::CE_ItemViewItem, &opt, painter );
|
||||||
|
|
||||||
if ( m_view->hoveredIndex().row() == index.row() && m_view->hoveredIndex().column() == index.column() &&
|
if ( m_view->hoveredIndex().row() == index.row() && m_view->hoveredIndex().column() == index.column() && !index.data().toString().isEmpty() &&
|
||||||
( index.column() == PlayableModel::Artist || index.column() == PlayableModel::Album || index.column() == PlayableModel::Track ) )
|
( index.column() == PlayableModel::Artist || index.column() == PlayableModel::Album || index.column() == PlayableModel::Track ) )
|
||||||
{
|
{
|
||||||
opt.rect.setWidth( opt.rect.width() - 16 );
|
opt.rect.setWidth( opt.rect.width() - 16 );
|
||||||
|
@@ -110,7 +110,7 @@ TreeItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
|
|||||||
o.rect.setX( oldX );
|
o.rect.setX( oldX );
|
||||||
|
|
||||||
if ( m_view->hoveredIndex().row() == index.row() && m_view->hoveredIndex().column() == index.column() &&
|
if ( m_view->hoveredIndex().row() == index.row() && m_view->hoveredIndex().column() == index.column() &&
|
||||||
( index.column() == 0 ) )
|
!index.data().toString().isEmpty() && index.column() == 0 )
|
||||||
{
|
{
|
||||||
o.rect.setWidth( o.rect.width() - 16 );
|
o.rect.setWidth( o.rect.width() - 16 );
|
||||||
QRect arrowRect( o.rect.x() + o.rect.width(), o.rect.y() + 1, o.rect.height() - 2, o.rect.height() - 2 );
|
QRect arrowRect( o.rect.x() + o.rect.width(), o.rect.y() + 1, o.rect.height() - 2, o.rect.height() - 2 );
|
||||||
|
Reference in New Issue
Block a user