Download labels now clickable.

This commit is contained in:
Martin Rotter 2015-04-01 06:50:50 +02:00
parent 9c1a2f7647
commit 590993eb8f
2 changed files with 16 additions and 4 deletions

View File

@ -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);

6
src/gui/statusbar.h Normal file → Executable file
View File

@ -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