From 590993eb8fc97b9db336ece7b3f934396b2c3911 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Wed, 1 Apr 2015 06:50:50 +0200 Subject: [PATCH] Download labels now clickable. --- src/gui/statusbar.cpp | 14 ++++++++++++-- src/gui/statusbar.h | 6 ++++-- 2 files changed, 16 insertions(+), 4 deletions(-) mode change 100644 => 100755 src/gui/statusbar.h diff --git a/src/gui/statusbar.cpp b/src/gui/statusbar.cpp index bb233e791..12f5ea450 100755 --- a/src/gui/statusbar.cpp +++ b/src/gui/statusbar.cpp @@ -58,8 +58,8 @@ StatusBar::StatusBar(QWidget *parent) : QStatusBar(parent) { m_lblProgressDownload->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); m_lblProgressDownload->setVisible(false); - // TODO: nastavit event filter na label a progress aby se po kliku - // otevřel download manager + m_lblProgressDownload->installEventFilter(this); + m_barProgressDownload->installEventFilter(this); // Add widgets. addPermanentWidget(m_lblProgressFeeds); @@ -77,6 +77,16 @@ void StatusBar::displayDownloadManager() { qApp->mainForm()->tabWidget()->showDownloadManager(); } +bool StatusBar::eventFilter(QObject *watched, QEvent *event) { + if (watched == m_lblProgressDownload || watched == m_barProgressDownload) { + if (event->type() == QEvent::MouseButtonPress) { + displayDownloadManager(); + } + } + + return false; +} + void StatusBar::showProgressFeeds(int progress, const QString &label) { m_lblProgressFeeds->setVisible(true); m_barProgressFeeds->setVisible(true); diff --git a/src/gui/statusbar.h b/src/gui/statusbar.h old mode 100644 new mode 100755 index e4a5d5090..b6495bd6f --- a/src/gui/statusbar.h +++ b/src/gui/statusbar.h @@ -47,13 +47,15 @@ class StatusBar : public QStatusBar { void displayDownloadManager(); + protected: + bool eventFilter(QObject *watched, QEvent *event); + private: QProgressBar *m_barProgressFeeds; QLabel *m_lblProgressFeeds; QProgressBar *m_barProgressDownload; QLabel *m_lblProgressDownload; - QToolButton *m_fullscreenSwitcher; - + QToolButton *m_fullscreenSwitcher; }; #endif // STATUSBAR_H