forked from qt-creator/qt-creator
		
	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: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
		@@ -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)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user