diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-06-12 18:04:42 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-06-12 18:04:42 -0400 |
| commit | 16d6a4c528fd226ac5bf9a2ff54911c567d5bca0 (patch) | |
| tree | 4eb5011470de5b0ed5a935b069c2523a8d0cae64 /src/statusbar.h | |
| parent | dc08c12fe8cde84c7cf507954d090d572ac865d5 (diff) | |
added a StatusBarNotifications class to handle icon, text and double click
Diffstat (limited to 'src/statusbar.h')
| -rw-r--r-- | src/statusbar.h | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/statusbar.h b/src/statusbar.h index bf14ba57..8edfd037 100644 --- a/src/statusbar.h +++ b/src/statusbar.h @@ -8,20 +8,38 @@ struct APIStats; class APIUserAccount; class Settings; + +class StatusBarNotifications : public QWidget +{ +public: + StatusBarNotifications(QAction* action); + + void update(bool hasNotifications); + +protected: + void mouseDoubleClickEvent(QMouseEvent* e) override; + +private: + QAction* m_action; + QLabel* m_icon; + QLabel* m_text; +}; + + class StatusBar { public: - StatusBar(QStatusBar* bar, QAction* notifications); + StatusBar(QStatusBar* bar, QAction* actionNotifications); void setProgress(int percent); - void setHasNotifications(bool b); + void updateNotifications(bool hasNotifications); void updateAPI(const APIStats& stats, const APIUserAccount& user); void checkSettings(const Settings& settings); private: QStatusBar* m_bar; + StatusBarNotifications* m_notifications; QProgressBar* m_progress; - QToolButton* m_notifications; QLabel* m_api; }; |
