Skip to content

Commit

Permalink
MoodbarProxyStyle: Stop timeline if already running
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaski committed Nov 9, 2024
1 parent b16fbb3 commit 0d2e933
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/moodbar/moodbarproxystyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,14 @@ void MoodbarProxyStyle::NextState() {
return;
}

const QTimeLine::Direction direction = visible ? QTimeLine::Forward : QTimeLine::Backward;
const QTimeLine::Direction direction = visible ? QTimeLine::Direction::Forward : QTimeLine::Direction::Backward;

if (state_ == State::MoodbarOn || state_ == State::MoodbarOff) {
// Start the fade from the beginning.
fade_timeline_->setDirection(direction);
if (fade_timeline_->state() != QTimeLine::State::NotRunning) {
fade_timeline_->stop();
}
fade_timeline_->start();

fade_source_ = QPixmap();
Expand Down

0 comments on commit 0d2e933

Please sign in to comment.