From 0d2e933ed1d9aba08edcb264f57268f1f118e711 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Sat, 9 Nov 2024 19:18:38 +0100 Subject: [PATCH] MoodbarProxyStyle: Stop timeline if already running --- src/moodbar/moodbarproxystyle.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/moodbar/moodbarproxystyle.cpp b/src/moodbar/moodbarproxystyle.cpp index 716489db0..6e8838dca 100644 --- a/src/moodbar/moodbarproxystyle.cpp +++ b/src/moodbar/moodbarproxystyle.cpp @@ -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();