Mercurial > minori
diff include/gui/theme.h @ 279:657fda1b9cac
*: clean up enums
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Fri, 19 Apr 2024 13:24:06 -0400 |
parents | 3ec7804abf17 |
children |
line wrap: on
line diff
--- a/include/gui/theme.h Thu Apr 18 17:24:42 2024 -0400 +++ b/include/gui/theme.h Fri Apr 19 13:24:06 2024 -0400 @@ -1,30 +1,36 @@ #ifndef MINORI_GUI_THEME_H_ #define MINORI_GUI_THEME_H_ -#include <QStyle> - -enum class Themes { - OS, - LIGHT, - DARK -}; +#include <array> namespace Theme { -class Theme final { +enum class Theme { + Default, + Light, + Dark +}; + +constexpr std::array<Theme, 3> Themes{ + Theme::Default, + Theme::Light, + Theme::Dark +}; + +class ThemeManager final { public: - Theme(Themes theme = Themes::OS); - void SetTheme(Themes theme); - Themes GetTheme() const; + ThemeManager(Theme theme = Theme::Default); + void SetTheme(Theme theme); + Theme GetTheme() const; bool IsInDarkTheme() const; void RepaintCurrentTheme(); private: void SetToDarkTheme(); void SetToLightTheme(); - void SetStyleSheet(Themes theme); - Themes GetCurrentOSTheme() const; - Themes theme; + void SetStyleSheet(Theme theme); + Theme GetCurrentOSTheme() const; + Theme theme; }; } // namespace Theme