Update piano_roll.cpp

A better way to update the play button icons, which requires less "if" checks and method calls in total.
This commit is contained in:
Alexandre Almeida
2014-02-09 18:46:39 -02:00
parent 774d09b7a1
commit 5239afb3e4

View File

@@ -798,22 +798,15 @@ void pianoRoll::loadSettings( const QDomElement & _this )
void pianoRoll::updatePlayPauseIcon()
void pianoRoll::setPauseIcon( bool pause )
{
if( engine::getSong()->playMode() != song::Mode_PlayPattern )
if( pause == true )
{
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
m_playButton->setIcon( embed::getIconPixmap( "pause" ) );
}
else
{
if( engine::getSong()->isPlaying() )
{
m_playButton->setIcon( embed::getIconPixmap( "pause" ) );
}
else
{
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
}
m_playButton->setIcon( embed::getIconPixmap( "play" ) );
}
}