Mercurial > minori
annotate include/gui/theme.h @ 373:fbc8c617de80
dep/animone: exception handling is the worst c++ anti-feature
author | Paper <paper@tflc.us> |
---|---|
date | Fri, 25 Jul 2025 11:03:05 -0400 |
parents | 47c9f8502269 |
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 | |
369 | 14 constexpr std::array<Theme, 3> Themes{Theme::Default, Theme::Light, Theme::Dark}; |
279 | 15 |
16 class ThemeManager final { | |
258 | 17 public: |
279 | 18 ThemeManager(Theme theme = Theme::Default); |
19 void SetTheme(Theme theme); | |
20 Theme GetTheme() const; | |
258 | 21 bool IsInDarkTheme() const; |
22 void RepaintCurrentTheme(); | |
102 | 23 |
258 | 24 private: |
25 void SetToDarkTheme(); | |
26 void SetToLightTheme(); | |
279 | 27 void SetStyleSheet(Theme theme); |
28 Theme GetCurrentOSTheme() const; | |
29 Theme theme; | |
102 | 30 }; |
31 | |
32 } // namespace Theme | |
33 | |
261
3ec7804abf17
include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents:
258
diff
changeset
|
34 #endif // MINORI_GUI_THEME_H_ |