mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-08 07:07:05 +02:00
Fix bug where all stars could actr as if they were hovered in all the items
This commit is contained in:
@@ -192,7 +192,7 @@ GetNewStuffDelegate::paint( QPainter* painter, const QStyleOptionViewItem& optio
|
|||||||
m_cachedStarRects[ QPair<int, int>(index.row(), index.column()) ] = r;
|
m_cachedStarRects[ QPair<int, int>(index.row(), index.column()) ] = r;
|
||||||
|
|
||||||
QPixmap pm;
|
QPixmap pm;
|
||||||
if ( m_hoveringOver > -1 )
|
if ( m_hoveringOver > -1 && ( m_hoveringItem.first == index.row() && m_hoveringItem.second == index.column() ) )
|
||||||
{
|
{
|
||||||
if ( i <= m_hoveringOver ) // positive star
|
if ( i <= m_hoveringOver ) // positive star
|
||||||
painter->drawPixmap( r, m_onHoverStar );
|
painter->drawPixmap( r, m_onHoverStar );
|
||||||
@@ -303,6 +303,8 @@ GetNewStuffDelegate::editorEvent( QEvent* event, QAbstractItemModel* model, cons
|
|||||||
{
|
{
|
||||||
// 0-indexed
|
// 0-indexed
|
||||||
m_hoveringOver = whichStar;
|
m_hoveringOver = whichStar;
|
||||||
|
m_hoveringItem.first = index.row();
|
||||||
|
m_hoveringItem.second = index.column();
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@@ -39,6 +39,7 @@ private:
|
|||||||
|
|
||||||
int m_widestTextWidth;
|
int m_widestTextWidth;
|
||||||
int m_hoveringOver;
|
int m_hoveringOver;
|
||||||
|
QPair<int, int> m_hoveringItem;
|
||||||
mutable QHash< QPair<int, int>, QRect > m_cachedButtonRects;
|
mutable QHash< QPair<int, int>, QRect > m_cachedButtonRects;
|
||||||
mutable QHash< QPair<int, int>, QRect > m_cachedStarRects;
|
mutable QHash< QPair<int, int>, QRect > m_cachedStarRects;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user