mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 06:07:37 +02:00
* Switch to a pointing hand cursor when hovering an artist name in AlbumItemDelegate.
This commit is contained in:
@@ -280,6 +280,11 @@ AlbumItemDelegate::editorEvent( QEvent* event, QAbstractItemModel* model, const
|
|||||||
|
|
||||||
if ( event->type() == QEvent::MouseMove )
|
if ( event->type() == QEvent::MouseMove )
|
||||||
{
|
{
|
||||||
|
if ( hoveringArtist )
|
||||||
|
m_view->setCursor( Qt::PointingHandCursor );
|
||||||
|
else
|
||||||
|
m_view->setCursor( Qt::ArrowCursor );
|
||||||
|
|
||||||
foreach ( const QModelIndex& idx, m_playButton.keys() )
|
foreach ( const QModelIndex& idx, m_playButton.keys() )
|
||||||
{
|
{
|
||||||
if ( index != idx )
|
if ( index != idx )
|
||||||
@@ -352,8 +357,12 @@ AlbumItemDelegate::editorEvent( QEvent* event, QAbstractItemModel* model, const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// reset mouse cursor. we switch to a pointing hand cursor when hovering an artist name
|
||||||
|
m_view->setCursor( Qt::ArrowCursor );
|
||||||
|
|
||||||
if ( hoveringArtist )
|
if ( hoveringArtist )
|
||||||
{
|
{
|
||||||
|
|
||||||
if ( event->type() == QEvent::MouseButtonRelease )
|
if ( event->type() == QEvent::MouseButtonRelease )
|
||||||
{
|
{
|
||||||
PlayableItem* item = m_model->sourceModel()->itemFromIndex( m_model->mapToSource( index ) );
|
PlayableItem* item = m_model->sourceModel()->itemFromIndex( m_model->mapToSource( index ) );
|
||||||
|
Reference in New Issue
Block a user