mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-04-13 04:21:51 +02:00
* Fix crash in TopBar when fading out dudes.
This commit is contained in:
parent
96e7ea91f2
commit
da92dbfc4b
@ -97,8 +97,8 @@ TopBar::fadeInDude( unsigned int i )
|
||||
{
|
||||
// qDebug() << Q_FUNC_INFO << i;
|
||||
|
||||
QLabel * dude = m_dudes.at( i );
|
||||
QPropertyAnimation * ani = new QPropertyAnimation( dude, "pos" );
|
||||
QLabel* dude = m_dudes.at( i );
|
||||
QPropertyAnimation* ani = new QPropertyAnimation( dude, "pos" );
|
||||
ani->setDuration( 1000 );
|
||||
ani->setEasingCurve( QEasingCurve::InQuad );
|
||||
ani->setStartValue( QPoint( -10,0 ) );
|
||||
@ -115,8 +115,8 @@ TopBar::fadeOutDude( unsigned int i )
|
||||
{
|
||||
// qDebug() << Q_FUNC_INFO << i;
|
||||
|
||||
QLabel * dude = m_dudes.at( i );
|
||||
QPropertyAnimation * ani = new QPropertyAnimation( dude, "pos" );
|
||||
QLabel* dude = m_dudes.at( i );
|
||||
QPropertyAnimation* ani = new QPropertyAnimation( dude, "pos" );
|
||||
ani->setDuration( 1000 );
|
||||
ani->setEasingCurve( QEasingCurve::OutQuad );
|
||||
ani->setStartValue( dude->pos() );
|
||||
@ -152,12 +152,14 @@ TopBar::setNumSources( unsigned int i )
|
||||
}
|
||||
else
|
||||
{
|
||||
int k = qMin( (unsigned int)2, m_sources - 1 );
|
||||
int k = qMin( (unsigned int)MAXDUDES - 1, m_sources - 1 );
|
||||
do
|
||||
{
|
||||
fadeOutDude( k-- );
|
||||
fadeOutDude( k );
|
||||
m_sources--;
|
||||
} while( m_sources != i );
|
||||
} while( k-- > i );
|
||||
|
||||
m_sources = i;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user