mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-19 15:29:42 +01:00
Don't accept button press events as well as release when handling latches
This commit is contained in:
parent
7badddb99c
commit
0569ee0f1a
@ -454,11 +454,15 @@ SourceDelegate::editorEvent ( QEvent* event, QAbstractItemModel* model, const QS
|
||||
// tDebug() << "CHECKING CLICK RECT:" << headphonesRect;
|
||||
if ( headphonesRect.contains( ev->pos() ) )
|
||||
{
|
||||
if ( index.data( SourcesModel::LatchedOnRole ).toBool() )
|
||||
// unlatch
|
||||
emit latchOff( colItem->source() );
|
||||
else
|
||||
emit latchOn( colItem->source() );
|
||||
if ( event->type() == QEvent::MouseButtonRelease )
|
||||
{
|
||||
if ( index.data( SourcesModel::LatchedOnRole ).toBool() )
|
||||
// unlatch
|
||||
emit latchOff( colItem->source() );
|
||||
else
|
||||
emit latchOn( colItem->source() );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user