Mercurial > minori
annotate include/gui/theme.h @ 321:8141f409d52c
services/anilist: fix getting producers
should studios and producers be stored separately?
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Wed, 12 Jun 2024 20:42:44 -0400 |
parents | 657fda1b9cac |
children |
rev | line source |
---|---|
261
3ec7804abf17
include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents:
258
diff
changeset
|
1 #ifndef MINORI_GUI_THEME_H_ |
3ec7804abf17
include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents:
258
diff
changeset
|
2 #define MINORI_GUI_THEME_H_ |
102 | 3 |
279 | 4 #include <array> |
102 | 5 |
6 namespace Theme { | |
7 | |
279 | 8 enum class Theme { |
9 Default, | |
10 Light, | |
11 Dark | |
12 }; | |
13 | |
14 constexpr std::array<Theme, 3> Themes{ | |
15 Theme::Default, | |
16 Theme::Light, | |
17 Theme::Dark | |
18 }; | |
19 | |
20 class ThemeManager final { | |
258 | 21 public: |
279 | 22 ThemeManager(Theme theme = Theme::Default); |
23 void SetTheme(Theme theme); | |
24 Theme GetTheme() const; | |
258 | 25 bool IsInDarkTheme() const; |
26 void RepaintCurrentTheme(); | |
102 | 27 |
258 | 28 private: |
29 void SetToDarkTheme(); | |
30 void SetToLightTheme(); | |
279 | 31 void SetStyleSheet(Theme theme); |
32 Theme GetCurrentOSTheme() const; | |
33 Theme theme; | |
102 | 34 }; |
35 | |
36 } // namespace Theme | |
37 | |
261
3ec7804abf17
include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents:
258
diff
changeset
|
38 #endif // MINORI_GUI_THEME_H_ |