Commit 07c0a834 authored by Eike Ziller's avatar Eike Ziller

Progress summary: Forward click to "current" progress details.

It was annoying that it wasn't possible to click on the summary progress
bar to e.g. open the compile output or issues pane, even when you had
only a build running.

This change forwards the click to either the progress that currently
shows a details widget in the status bar (like the build errors/warnings
from the build progress), or to the last progress that was started.

Change-Id: I4b50dd4b43bdc12fac329d33e158fa759bee4d28
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 0b57c8de
......@@ -46,6 +46,7 @@
#include <QAction>
#include <QEvent>
#include <QHBoxLayout>
#include <QMouseEvent>
#include <QPainter>
#include <QPropertyAnimation>
#include <QStyle>
......@@ -379,6 +380,19 @@ bool ProgressManagerPrivate::eventFilter(QObject *obj, QEvent *event)
m_hovered = false;
// give the progress view the chance to get the mouse enter event
updateVisibilityWithDelay();
} else if (obj == m_statusBarWidget && event->type() == QEvent::MouseButtonPress
&& !m_taskList.isEmpty()) {
QMouseEvent *me = static_cast<QMouseEvent *>(event);
if (me->button() == Qt::LeftButton && !me->modifiers()) {
FutureProgress *progress = m_currentStatusDetailsProgress;
if (!progress)
progress = m_taskList.last();
// don't send signal directly from an event filter, event filters should
// do as little a possible
QTimer::singleShot(0, progress, SIGNAL(clicked()));
event->accept();
return true;
}
}
return false;
}
......@@ -643,8 +657,10 @@ void ProgressManagerPrivate::updateStatusDetailsWidget()
while (i != m_taskList.begin()) {
--i;
candidateWidget = (*i)->statusBarWidget();
if (candidateWidget)
if (candidateWidget) {
m_currentStatusDetailsProgress = *i;
break;
}
}
if (candidateWidget == m_currentStatusDetailsWidget)
......
......@@ -108,6 +108,7 @@ private:
QWidget *m_summaryProgressWidget;
QHBoxLayout *m_summaryProgressLayout;
QWidget *m_currentStatusDetailsWidget;
QPointer<FutureProgress> m_currentStatusDetailsProgress;
ProgressBar *m_summaryProgressBar;
QGraphicsOpacityEffect *m_opacityEffect;
QPointer<QPropertyAnimation> m_opacityAnimation;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment