From 10858d0a6bf31ce40aa89dbc20be7c1283a3e393 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Sat, 16 Jun 2012 11:25:57 +0200 Subject: [PATCH] * Check hover index to display info buttons in TreeItemDelegate. --- src/libtomahawk/playlist/TreeItemDelegate.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/libtomahawk/playlist/TreeItemDelegate.cpp b/src/libtomahawk/playlist/TreeItemDelegate.cpp index b171ed49e..a53662d7f 100644 --- a/src/libtomahawk/playlist/TreeItemDelegate.cpp +++ b/src/libtomahawk/playlist/TreeItemDelegate.cpp @@ -109,6 +109,16 @@ TreeItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, if ( oldX > 0 ) o.rect.setX( oldX ); + if ( m_view->hoveredIndex().row() == index.row() && m_view->hoveredIndex().column() == index.column() && + ( index.column() == 0 ) ) + { + 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 ); + + QPixmap infoIcon = TomahawkUtils::defaultPixmap( TomahawkUtils::InfoIcon, TomahawkUtils::Original, arrowRect.size() ); + painter->drawPixmap( arrowRect, infoIcon ); + } + { QRect r = o.rect.adjusted( 3, 0, 0, 0 );