1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 14:16:32 +02:00

Don't accept button press events as well as release when handling latches

This commit is contained in:
Leo Franchi
2011-11-14 16:03:29 -05:00
parent 7badddb99c
commit 0569ee0f1a

View File

@@ -453,6 +453,8 @@ SourceDelegate::editorEvent ( QEvent* event, QAbstractItemModel* model, const QS
QRect headphonesRect( option.rect.height() + 10, o.rect.bottom() - height, height, height ); QRect headphonesRect( option.rect.height() + 10, o.rect.bottom() - height, height, height );
// tDebug() << "CHECKING CLICK RECT:" << headphonesRect; // tDebug() << "CHECKING CLICK RECT:" << headphonesRect;
if ( headphonesRect.contains( ev->pos() ) ) if ( headphonesRect.contains( ev->pos() ) )
{
if ( event->type() == QEvent::MouseButtonRelease )
{ {
if ( index.data( SourcesModel::LatchedOnRole ).toBool() ) if ( index.data( SourcesModel::LatchedOnRole ).toBool() )
// unlatch // unlatch
@@ -460,6 +462,8 @@ SourceDelegate::editorEvent ( QEvent* event, QAbstractItemModel* model, const QS
else else
emit latchOn( colItem->source() ); emit latchOn( colItem->source() );
} }
return true;
}
} }
} }
} }