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:
@@ -454,11 +454,15 @@ SourceDelegate::editorEvent ( QEvent* event, QAbstractItemModel* model, const QS
|
|||||||
// tDebug() << "CHECKING CLICK RECT:" << headphonesRect;
|
// tDebug() << "CHECKING CLICK RECT:" << headphonesRect;
|
||||||
if ( headphonesRect.contains( ev->pos() ) )
|
if ( headphonesRect.contains( ev->pos() ) )
|
||||||
{
|
{
|
||||||
if ( index.data( SourcesModel::LatchedOnRole ).toBool() )
|
if ( event->type() == QEvent::MouseButtonRelease )
|
||||||
// unlatch
|
{
|
||||||
emit latchOff( colItem->source() );
|
if ( index.data( SourcesModel::LatchedOnRole ).toBool() )
|
||||||
else
|
// unlatch
|
||||||
emit latchOn( colItem->source() );
|
emit latchOff( colItem->source() );
|
||||||
|
else
|
||||||
|
emit latchOn( colItem->source() );
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user