summaryrefslogtreecommitdiff
path: root/src/statusbar.h
diff options
context:
space:
mode:
authorSilarn <jrim@rimpo.org>2019-07-22 01:00:42 -0500
committerSilarn <jrim@rimpo.org>2019-07-22 01:00:42 -0500
commitdcd6d624672019727d7effd17aac86f72bff438b (patch)
tree1e8d3856f657d898c5992631599cf272d785f973 /src/statusbar.h
parent179a73857125ee604f42b0d5c2d765183c86d2c7 (diff)
parente73c309f08eff98f0dbd2590f594a83b67431eac (diff)
Merge branch 'Develop'
Diffstat (limited to 'src/statusbar.h')
-rw-r--r--src/statusbar.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/statusbar.h b/src/statusbar.h
new file mode 100644
index 00000000..2baf12ee
--- /dev/null
+++ b/src/statusbar.h
@@ -0,0 +1,51 @@
+#ifndef MO_STATUSBAR_H
+#define MO_STATUSBAR_H
+
+#include <QStatusBar>
+#include <QProgressBar>
+
+struct APIStats;
+class APIUserAccount;
+class Settings;
+namespace Ui { class MainWindow; }
+
+
+class StatusBarAction : public QWidget
+{
+public:
+ StatusBarAction(QAction* action);
+
+ void set(bool visible);
+
+protected:
+ void mouseDoubleClickEvent(QMouseEvent* e) override;
+
+private:
+ QAction* m_action;
+ QLabel* m_icon;
+ QLabel* m_text;
+
+ QString cleanupActionText(const QString& s) const;
+};
+
+
+class StatusBar
+{
+public:
+ StatusBar(QStatusBar* bar, Ui::MainWindow* ui);
+
+ void setProgress(int percent);
+ void setNotifications(bool hasNotifications);
+ void setAPI(const APIStats& stats, const APIUserAccount& user);
+ void setUpdateAvailable(bool b);
+ void checkSettings(const Settings& settings);
+
+private:
+ QStatusBar* m_bar;
+ QProgressBar* m_progress;
+ StatusBarAction* m_notifications;
+ StatusBarAction* m_update;
+ QLabel* m_api;
+};
+
+#endif // MO_STATUSBAR_H