mirror of
https://github.com/LMMS/lmms.git
synced 2026-03-20 06:58:22 -04:00
Update song_editor.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:
@@ -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" ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user