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