summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qgtkstyle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/styles/qgtkstyle.cpp')
-rw-r--r--src/widgets/styles/qgtkstyle.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/widgets/styles/qgtkstyle.cpp b/src/widgets/styles/qgtkstyle.cpp
index 83e70d022b..2c8bc4c188 100644
--- a/src/widgets/styles/qgtkstyle.cpp
+++ b/src/widgets/styles/qgtkstyle.cpp
@@ -3488,15 +3488,15 @@ void QGtkStyle::drawControl(ControlElement element,
progressBar.setRect(rect.left(), rect.top(), width, rect.height());
else
progressBar.setRect(rect.right() - width, rect.top(), width, rect.height());
-
+ d->stopAnimation(option->styleObject);
} else {
Q_D(const QGtkStyle);
int slideWidth = ((rect.width() - 4) * 2) / 3;
int step = 0;
-#ifndef QT_NO_ANIMATION
- if (QProgressStyleAnimation *animation = qobject_cast<QProgressStyleAnimation*>(d->animation(widget)))
+ if (QProgressStyleAnimation *animation = qobject_cast<QProgressStyleAnimation*>(d->animation(option->styleObject)))
step = animation->progressStep(slideWidth);
-#endif
+ else
+ d->startAnimation(new QProgressStyleAnimation(d->animationFps, option->styleObject));
progressBar.setRect(rect.left() + step, rect.top(), slideWidth / 2, rect.height());
}