From 5239afb3e461a61a22f6daf741e9c621d642ba0c Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Sun, 9 Feb 2014 18:46:39 -0200 Subject: [PATCH] Update piano_roll.cpp A better way to update the play button icons, which requires less "if" checks and method calls in total. --- src/gui/piano_roll.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/gui/piano_roll.cpp b/src/gui/piano_roll.cpp index 46b78b2c8..caaf0d7d0 100644 --- a/src/gui/piano_roll.cpp +++ b/src/gui/piano_roll.cpp @@ -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" ) ); } }