From 774d09b7a10991973aedd5349f3a930702bded52 Mon Sep 17 00:00:00 2001 From: Alexandre Almeida Date: Sun, 9 Feb 2014 18:44:51 -0200 Subject: [PATCH] Update song_editor.cpp A better way to update the play button icons, which requires less "if" checks and method calls in total. --- src/gui/song_editor.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/gui/song_editor.cpp b/src/gui/song_editor.cpp index 822ef8bc49..d4376fd7f2 100644 --- a/src/gui/song_editor.cpp +++ b/src/gui/song_editor.cpp @@ -429,22 +429,15 @@ void songEditor::scrolled( int _new_pos ) -void songEditor::updatePlayPauseIcon() +void songEditor::setPauseIcon( bool pause ) { - if( engine::getSong()->playMode() != song::Mode_PlaySong ) + 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" ) ); } }