summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJens Bache-Wiig <jens.bache-wiig@nokia.com>2011-04-06 12:35:36 (GMT)
committerQt Commercial Integration <QtCommercial@digia.com>2012-01-31 10:24:50 (GMT)
commit42c854c5a14a038633881fc0641838d9459d2358 (patch)
tree6680d07766b9b193ab5a3592f23d71ff54ed3076 /src
parent36974b766ea4dac594680b246dd22311c30f9adb (diff)
downloadQt-42c854c5a14a038633881fc0641838d9459d2358.zip
Qt-42c854c5a14a038633881fc0641838d9459d2358.tar.gz
Qt-42c854c5a14a038633881fc0641838d9459d2358.tar.bz2
Fix progressbar animation on Vista
This fixes two issues. - The indeterminate animation was sometimes incorrectly disabled when value was 0 - The progress animation was incorrectly stopped when progress bars were disabled Task-number: QTBUG-10957 Reviewed-by: richard
Diffstat (limited to 'src')
-rw-r--r--src/gui/styles/qwindowsvistastyle.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gui/styles/qwindowsvistastyle.cpp b/src/gui/styles/qwindowsvistastyle.cpp
index d882bf1..5d534fb 100644
--- a/src/gui/styles/qwindowsvistastyle.cpp
+++ b/src/gui/styles/qwindowsvistastyle.cpp
@@ -973,7 +973,8 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(option))
{
- if (QWindowsVistaAnimation *anim = d->widgetAnimation(widget)) {
+ QWindowsVistaAnimation *anim = d->widgetAnimation(widget);
+ if (anim && (btn->state & State_Enabled)) {
anim->paint(painter, option);
} else {
name = QLatin1String("BUTTON");
@@ -1000,7 +1001,6 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
!(state & (State_Sunken | State_On)) && !(state & State_MouseOver) &&
(state & State_Enabled) && (state & State_Active))
{
- QWindowsVistaAnimation *anim = d->widgetAnimation(widget);
if (!anim && widget) {
QImage startImage(option->rect.size(), QImage::Format_ARGB32_Premultiplied);
startImage.fill(0);
@@ -1078,8 +1078,8 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
}
if (const QProgressBar *progressbar = qobject_cast<const QProgressBar *>(widget)) {
- if (((progressbar->value() > 0 && d->transitionsEnabled()) || isIndeterminate)) {
- if (!d->widgetAnimation(progressbar) && progressbar->value() < progressbar->maximum()) {
+ if (isIndeterminate || (progressbar->value() > 0 && (progressbar->value() < progressbar->maximum()) && d->transitionsEnabled())) {
+ if (!d->widgetAnimation(progressbar)) {
QWindowsVistaAnimation *a = new QWindowsVistaAnimation;
a->setWidget(const_cast<QWidget*>(widget));
a->setStartTime(QTime::currentTime());
@@ -2506,7 +2506,6 @@ void QWindowsVistaStylePrivate::timerEvent()
animations[i]->widget()->update();
if (!animations[i]->widget() ||
- !animations[i]->widget()->isEnabled() ||
!animations[i]->widget()->isVisible() ||
animations[i]->widget()->window()->isMinimized() ||
!animations[i]->running() ||