diff --git a/src/plugins/coreplugin/progressmanager/futureprogress.cpp b/src/plugins/coreplugin/progressmanager/futureprogress.cpp index f1b888153af96808cdd0ae9819fed8ef53b1090f..105e3aa3b0ce9e0c368ffd947487125cca14d443 100644 --- a/src/plugins/coreplugin/progressmanager/futureprogress.cpp +++ b/src/plugins/coreplugin/progressmanager/futureprogress.cpp @@ -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" diff --git a/src/plugins/coreplugin/progressmanager/progressbar.cpp b/src/plugins/coreplugin/progressmanager/progressbar.cpp index 16e4ed905c53f6d346933cc94a5ad1f82a75c9e6..6bfb8294d19dad6a89a2dd4b3894c6069ebb3e03 100644 --- a/src/plugins/coreplugin/progressmanager/progressbar.cpp +++ b/src/plugins/coreplugin/progressmanager/progressbar.cpp @@ -41,11 +41,11 @@ using namespace Core; using namespace Core::Internal; -#define PROGRESSBAR_HEIGHT 13 +#define PROGRESSBAR_HEIGHT 12 #define CANCELBUTTON_SIZE 15 ProgressBar::ProgressBar(QWidget *parent) - : QWidget(parent), m_error(false), m_minimum(1), m_maximum(100), m_value(1), m_fader(0) + : QWidget(parent), m_error(false), m_minimum(1), m_maximum(100), m_value(1), m_cancelButtonFader(0) { setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); setMouseTracking(true); @@ -60,7 +60,7 @@ bool ProgressBar::event(QEvent *e) switch(e->type()) { case QEvent::Enter: { - QPropertyAnimation *animation = new QPropertyAnimation(this, "fader"); + QPropertyAnimation *animation = new QPropertyAnimation(this, "cancelButtonFader"); animation->setDuration(125); animation->setEndValue(1.0); animation->start(QAbstractAnimation::DeleteWhenStopped); @@ -68,7 +68,7 @@ bool ProgressBar::event(QEvent *e) break; case QEvent::Leave: { - QPropertyAnimation *animation = new QPropertyAnimation(this, "fader"); + QPropertyAnimation *animation = new QPropertyAnimation(this, "m_cancelButtonFader"); animation->setDuration(225); animation->setEndValue(0.0); animation->start(QAbstractAnimation::DeleteWhenStopped); @@ -133,7 +133,7 @@ QSize ProgressBar::sizeHint() const { QSize s; s.setWidth(50); - s.setHeight(fontMetrics().height() + PROGRESSBAR_HEIGHT + 9); + s.setHeight(fontMetrics().height() + PROGRESSBAR_HEIGHT + 6); return s; } @@ -204,7 +204,7 @@ void ProgressBar::paintEvent(QPaintEvent *) // elide the text QString elidedtitle = fm.elidedText(m_title, Qt::ElideRight, textSpace); - QRect textRect = rect().adjusted(INDENT + 1, 1, -INDENT - 1, 0); + QRect textRect = rect().adjusted(3, 1, -3, 0); textRect.setHeight(h+5); p.setPen(QColor(0, 0, 0, 120)); @@ -217,7 +217,7 @@ void ProgressBar::paintEvent(QPaintEvent *) m_progressHeight = PROGRESSBAR_HEIGHT; m_progressHeight += ((m_progressHeight % 2) + 1) % 2; // make odd // draw outer rect - QRect rect(INDENT - 1, h+8, size().width()-2*INDENT + 1, m_progressHeight-1); + QRect rect(INDENT - 1, h+6, size().width()-2*INDENT + 1, m_progressHeight-1); p.setPen(Utils::StyleHelper::panelTextColor()); Utils::StyleHelper::drawCornerImage(bar, &p, rect, 2, 2, 2, 2); @@ -262,7 +262,7 @@ void ProgressBar::paintEvent(QPaintEvent *) p.drawPoint(inner.bottomRight()); // Draw cancel button - p.setOpacity(m_fader); + p.setOpacity(m_cancelButtonFader); if (value() < maximum() && !m_error) { QRect cancelRect(rect.adjusted(rect.width() - CANCELBUTTON_SIZE, 1, -1, 0)); diff --git a/src/plugins/coreplugin/progressmanager/progressbar.h b/src/plugins/coreplugin/progressmanager/progressbar.h index 22a20f288c29bbb0be1d3d6df1ba30b26610e097..696867b789529b861c916a51da24ccf0a2f324c5 100644 --- a/src/plugins/coreplugin/progressmanager/progressbar.h +++ b/src/plugins/coreplugin/progressmanager/progressbar.h @@ -40,7 +40,7 @@ class ProgressBar : public QWidget { Q_OBJECT - Q_PROPERTY(float fader READ fader WRITE setFader) + Q_PROPERTY(float cancelButtonFader READ cancelButtonFader WRITE setCancelButtonFader) public: explicit ProgressBar(QWidget *parent = 0); @@ -60,8 +60,8 @@ public: void reset(); void setRange(int minimum, int maximum); void setValue(int value); - float fader() { return m_fader; } - void setFader(float value) { m_fader = value; update(); } + float cancelButtonFader() { return m_cancelButtonFader; } + void setCancelButtonFader(float value) { m_cancelButtonFader= value;} bool event(QEvent *); signals: @@ -79,7 +79,7 @@ private: int m_minimum; int m_maximum; int m_value; - float m_fader; + float m_cancelButtonFader; }; } // namespace Internal diff --git a/src/plugins/projectexplorer/buildprogress.cpp b/src/plugins/projectexplorer/buildprogress.cpp index e9c08a7d883fcaac57fd37300a3690ff1c2ca124..42b29bef5773b746c7ed3dce03842d5e9f87941a 100644 --- a/src/plugins/projectexplorer/buildprogress.cpp +++ b/src/plugins/projectexplorer/buildprogress.cpp @@ -48,16 +48,16 @@ BuildProgress::BuildProgress(TaskWindow *taskWindow) m_taskWindow(taskWindow) { QVBoxLayout *layout = new QVBoxLayout; - layout->setContentsMargins(8, 4, 0, 4); + layout->setContentsMargins(8, 2, 0, 2); layout->setSpacing(2); setLayout(layout); QHBoxLayout *errorLayout = new QHBoxLayout; - errorLayout->setSpacing(4); + errorLayout->setSpacing(2); layout->addLayout(errorLayout); errorLayout->addWidget(m_errorIcon); errorLayout->addWidget(m_errorLabel); QHBoxLayout *warningLayout = new QHBoxLayout; - warningLayout->setSpacing(4); + warningLayout->setSpacing(2); layout->addLayout(warningLayout); warningLayout->addWidget(m_warningIcon); warningLayout->addWidget(m_warningLabel);