From 16d6a4c528fd226ac5bf9a2ff54911c567d5bca0 Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Wed, 12 Jun 2019 18:04:42 -0400 Subject: added a StatusBarNotifications class to handle icon, text and double click --- src/statusbar.h | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'src/statusbar.h') 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; }; -- cgit v1.3.1