mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-04 21:27:58 +02:00
* Check hover index to display info buttons in TreeItemDelegate.
This commit is contained in:
@@ -109,6 +109,16 @@ TreeItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
|
|||||||
if ( oldX > 0 )
|
if ( oldX > 0 )
|
||||||
o.rect.setX( oldX );
|
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 );
|
QRect r = o.rect.adjusted( 3, 0, 0, 0 );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user