Download labels now clickable.
This commit is contained in:
parent
9c1a2f7647
commit
590993eb8f
@ -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
6
src/gui/statusbar.h
Normal file → Executable 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user