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->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
m_lblProgressDownload->setVisible(false); m_lblProgressDownload->setVisible(false);
// TODO: nastavit event filter na label a progress aby se po kliku m_lblProgressDownload->installEventFilter(this);
// otevřel download manager m_barProgressDownload->installEventFilter(this);
// Add widgets. // Add widgets.
addPermanentWidget(m_lblProgressFeeds); addPermanentWidget(m_lblProgressFeeds);
@ -77,6 +77,16 @@ void StatusBar::displayDownloadManager() {
qApp->mainForm()->tabWidget()->showDownloadManager(); 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) { void StatusBar::showProgressFeeds(int progress, const QString &label) {
m_lblProgressFeeds->setVisible(true); m_lblProgressFeeds->setVisible(true);
m_barProgressFeeds->setVisible(true); m_barProgressFeeds->setVisible(true);

4
src/gui/statusbar.h Normal file → Executable file
View file

@ -47,13 +47,15 @@ class StatusBar : public QStatusBar {
void displayDownloadManager(); void displayDownloadManager();
protected:
bool eventFilter(QObject *watched, QEvent *event);
private: private:
QProgressBar *m_barProgressFeeds; QProgressBar *m_barProgressFeeds;
QLabel *m_lblProgressFeeds; QLabel *m_lblProgressFeeds;
QProgressBar *m_barProgressDownload; QProgressBar *m_barProgressDownload;
QLabel *m_lblProgressDownload; QLabel *m_lblProgressDownload;
QToolButton *m_fullscreenSwitcher; QToolButton *m_fullscreenSwitcher;
}; };
#endif // STATUSBAR_H #endif // STATUSBAR_H