Mercurial > minori
annotate include/gui/window.h @ 112:80f49f623d30
locale: allow switching locales without restarting
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Mon, 06 Nov 2023 13:41:30 -0500 |
parents | 6d8da6e64d61 |
children | ab191e28e69d |
rev | line source |
---|---|
2 | 1 #ifndef __window_h |
7 | 2 #define __window_h |
9 | 3 #include "core/config.h" |
7 | 4 #include <QMainWindow> |
79 | 5 |
6 class QWidget; | |
7 class QStackedWidget; | |
8 class QCloseEvent; | |
9 class SideBar; | |
2 | 10 |
95
8043152ef9d4
include: set classes as final where appropriate
Paper <mrpapersonic@gmail.com>
parents:
79
diff
changeset
|
11 class MainWindow final : public QMainWindow { |
9 | 12 Q_OBJECT |
13 | |
2 | 14 public: |
15 MainWindow(QWidget* parent = nullptr); | |
16 void SetActivePage(QWidget* page); | |
79 | 17 void CreateBars(); |
112
80f49f623d30
locale: allow switching locales without restarting
Paper <mrpapersonic@gmail.com>
parents:
105
diff
changeset
|
18 void AddMainWidgets(); |
80f49f623d30
locale: allow switching locales without restarting
Paper <mrpapersonic@gmail.com>
parents:
105
diff
changeset
|
19 void RetranslateUI(); |
80f49f623d30
locale: allow switching locales without restarting
Paper <mrpapersonic@gmail.com>
parents:
105
diff
changeset
|
20 void AsyncSynchronize(QStackedWidget* stack); |
80f49f623d30
locale: allow switching locales without restarting
Paper <mrpapersonic@gmail.com>
parents:
105
diff
changeset
|
21 void changeEvent(QEvent* event) override; |
105
6d8da6e64d61
theme: add dark stylesheet, make it actually usable
Paper <mrpapersonic@gmail.com>
parents:
95
diff
changeset
|
22 void showEvent(QShowEvent* event) override; |
4
5af270662505
Set override functions as override
Paper <mrpapersonic@gmail.com>
parents:
2
diff
changeset
|
23 void closeEvent(QCloseEvent* event) override; |
2 | 24 |
25 private: | |
112
80f49f623d30
locale: allow switching locales without restarting
Paper <mrpapersonic@gmail.com>
parents:
105
diff
changeset
|
26 QWidget* main_widget = nullptr; |
80f49f623d30
locale: allow switching locales without restarting
Paper <mrpapersonic@gmail.com>
parents:
105
diff
changeset
|
27 QStackedWidget* stack = nullptr; |
80f49f623d30
locale: allow switching locales without restarting
Paper <mrpapersonic@gmail.com>
parents:
105
diff
changeset
|
28 SideBar* sidebar = nullptr; |
2 | 29 }; |
30 | |
31 #endif // __window_h |