mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-09 07:36:48 +02:00
Fix crash and shrink headphones
This commit is contained in:
@@ -201,7 +201,7 @@ SourceDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, co
|
|||||||
if ( !pm.isNull() )
|
if ( !pm.isNull() )
|
||||||
{
|
{
|
||||||
QRect pmRect = textRect;
|
QRect pmRect = textRect;
|
||||||
pmRect.setTop( pmRect.bottom() - painter->fontMetrics().height() - 3 );
|
pmRect.setTop( pmRect.bottom() - painter->fontMetrics().height() + 3 );
|
||||||
pmRect.setRight( pmRect.left() + pmRect.height() );
|
pmRect.setRight( pmRect.left() + pmRect.height() );
|
||||||
// tDebug() << "DOING HEADPHONES RECT:" << pmRect;
|
// tDebug() << "DOING HEADPHONES RECT:" << pmRect;
|
||||||
painter->drawPixmap( pmRect, pm.scaledToHeight( pmRect.height(), Qt::SmoothTransformation ) );
|
painter->drawPixmap( pmRect, pm.scaledToHeight( pmRect.height(), Qt::SmoothTransformation ) );
|
||||||
@@ -405,6 +405,7 @@ SourceDelegate::editorEvent ( QEvent* event, QAbstractItemModel* model, const QS
|
|||||||
{
|
{
|
||||||
CollectionItem* colItem = qobject_cast< CollectionItem* >( index.data( SourcesModel::SourceTreeItemRole ).value< SourceTreeItem* >() );
|
CollectionItem* colItem = qobject_cast< CollectionItem* >( index.data( SourcesModel::SourceTreeItemRole ).value< SourceTreeItem* >() );
|
||||||
Q_ASSERT( colItem );
|
Q_ASSERT( colItem );
|
||||||
|
|
||||||
if ( !colItem->source().isNull() && !colItem->source()->currentTrack().isNull() && !colItem->source()->isLocal() )
|
if ( !colItem->source().isNull() && !colItem->source()->currentTrack().isNull() && !colItem->source()->isLocal() )
|
||||||
{
|
{
|
||||||
QMouseEvent* ev = static_cast< QMouseEvent* >( event );
|
QMouseEvent* ev = static_cast< QMouseEvent* >( event );
|
||||||
|
Reference in New Issue
Block a user