1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 03:10:12 +02:00

improved animation

This commit is contained in:
Michael Zanetti
2011-08-22 23:38:42 +02:00
parent f1dfd84213
commit 2c5040c638
2 changed files with 5 additions and 4 deletions

View File

@@ -83,9 +83,10 @@ bool AnimationHelper::partlyExpanded()
if ( m_forceClosing )
return false;
return m_fullyExpanded
|| ( m_expandAnimation->state() == QPropertyAnimation::Running && m_expandAnimation->currentTime() > 250 )
|| ( m_collapseAnimation->state() == QPropertyAnimation::Running && m_collapseAnimation->currentTime() < 100 );
return m_size != m_startSize;
// return m_fullyExpanded
// || ( m_expandAnimation->state() == QPropertyAnimation::Running && m_expandAnimation->currentTime() > 250 )
// || ( m_collapseAnimation->state() == QPropertyAnimation::Running && m_collapseAnimation->currentTime() < 100 );
}
bool AnimationHelper::fullyExpanded()

View File

@@ -246,7 +246,7 @@ SourceDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, co
painter->setFont( font );
textRect = itemsRect.adjusted( 0, 4, 0, 0 );
painter->drawPixmap( textRect.x() + iconSpacing, textRect.y(), m_dropTypeImageMap.value( i ) );
painter->drawPixmap( textRect.x() + iconSpacing, textRect.y(), m_dropTypeImageMap.value( i ).copy( 0, 0, 32, qMax( 4, textRect.height() ) ) );
int textSpacing = ( itemWidth - painter->fontMetrics().width( m_dropTypeTextMap.value( i ) ) ) / 2;
textRect.adjust( textSpacing, 32 + 6, 0, 0 );