diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-08-16 09:00:31 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-08-16 09:00:31 -0400 |
| commit | 0374291a3451c464fb27e53077da42ad21c27cd6 (patch) | |
| tree | afea32cd268a15398bcee5c35e43331d125ea0a2 /src/statusbar.h | |
| parent | a5cb39aaf44b1f84003fb2ec2d36f07bf28916e4 (diff) | |
StatusBar now inherits from QStatusBar to handle hide/show events
merged settings into saveVisibility() and restoreVisibility()
call MainWindow::storeSettings() earlier so widget visibility is still valid
Diffstat (limited to 'src/statusbar.h')
| -rw-r--r-- | src/statusbar.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/statusbar.h b/src/statusbar.h index 2baf12ee..442b9acf 100644 --- a/src/statusbar.h +++ b/src/statusbar.h @@ -29,10 +29,12 @@ private: }; -class StatusBar +class StatusBar : public QStatusBar { public: - StatusBar(QStatusBar* bar, Ui::MainWindow* ui); + StatusBar(QWidget* parent=nullptr); + + void setup(Ui::MainWindow* ui); void setProgress(int percent); void setNotifications(bool hasNotifications); @@ -40,12 +42,18 @@ public: void setUpdateAvailable(bool b); void checkSettings(const Settings& settings); +protected: + void showEvent(QShowEvent* e); + void hideEvent(QHideEvent* e); + private: - QStatusBar* m_bar; + Ui::MainWindow* ui; QProgressBar* m_progress; StatusBarAction* m_notifications; StatusBarAction* m_update; QLabel* m_api; + + void visibilityChanged(bool visible); }; #endif // MO_STATUSBAR_H |
