diff options
Diffstat (limited to 'playerwidget.cpp')
-rw-r--r-- | playerwidget.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/playerwidget.cpp b/playerwidget.cpp index 5dcae99..30efedc 100644 --- a/playerwidget.cpp +++ b/playerwidget.cpp @@ -485,12 +485,6 @@ void PlayerWidget::doPlay(){ return; } - if(mPlayer->state() == QMediaPlayer::PausedState){ - mPlayer->play(); - mPlayA->setChecked(true); - emit playModeChanged(tr("Playing")); - return; - } QModelIndexList sel = mSongView->selectionModel()->selectedRows(); if(mPlayer->state() == QMediaPlayer::StoppedState){ if(sel.isEmpty()){ @@ -524,11 +518,22 @@ void PlayerWidget::doPause(){ void PlayerWidget::doPlayOrPause(){ if(mPlayA->isChecked()){ doPause(); - }else if(mPauseA->isChecked() || mStopA->isChecked()){ + }else if(mPauseA->isChecked()){ + doContinue(); + + }else if (mStopA->isChecked()){ doPlay(); } } +void PlayerWidget::doContinue(){ + mPlayer->play(); + mPlayA->setChecked(true); + emit playModeChanged(tr("Playing")); + mTrayIcon->setIcon(QIcon(":/play.png")); + mTrayIcon->setToolTip(tr("[Playing]")); +} + void PlayerWidget::volumeUp(){ adjustVolume(2); } |