Multiple fixes to the progress bars

* made them a few pixels smaller
* they now animate when collapsed
* they no longer fade out when an error is reported

Reviewed-by: thorbjorn
This commit is contained in:
Jens Bache-Wiig
2010-03-24 11:15:56 +01:00
parent 0cd098032c
commit c64d838890
4 changed files with 30 additions and 19 deletions

View File

@@ -40,6 +40,7 @@
#include <QtCore/QTimer>
#include <QtCore/QCoreApplication>
#include <QtCore/QPropertyAnimation>
#include <QtCore/QSequentialAnimationGroup>
#include <utils/stylehelper.h>
using namespace Core;
@@ -77,7 +78,8 @@ void FadeWidgetHack::paintEvent(QPaintEvent *)
QPainter p(this);
p.setOpacity(m_opacity);
Utils::StyleHelper::verticalGradient(&p, rect(), rect());
if (m_opacity > 0)
Utils::StyleHelper::verticalGradient(&p, rect(), rect());
}
/*!
@@ -237,7 +239,7 @@ void FutureProgress::setFinished()
if (m_keep) {
m_waitingForUserInteraction = true;
qApp->installEventFilter(this);
} else {
} else if (!m_progress->hasError()) {
QTimer::singleShot(notificationTimeout, this, SLOT(fadeAway()));
}
}
@@ -303,11 +305,20 @@ bool FutureProgress::hasError() const
void FutureProgress::fadeAway()
{
m_faderWidget->raise();
QSequentialAnimationGroup *group = new QSequentialAnimationGroup;
QPropertyAnimation *animation = new QPropertyAnimation(m_faderWidget, "opacity");
animation->setDuration(600);
animation->setEndValue(1.0);
animation->start(QAbstractAnimation::DeleteWhenStopped);
connect(animation, SIGNAL(finished()), this, SIGNAL(removeMe()));
group->addAnimation(animation);
animation = new QPropertyAnimation(this, "maximumHeight");
animation->setDuration(120);
animation->setEasingCurve(QEasingCurve::InCurve);
animation->setStartValue(sizeHint().height());
animation->setEndValue(0.0);
group->addAnimation(animation);
group->start(QAbstractAnimation::DeleteWhenStopped);
connect(group, SIGNAL(finished()), this, SIGNAL(removeMe()));
}
#include "futureprogress.moc"