annotate include/gui/theme.h @ 327:b5d6c27c308f

anime: refactor Anime::SeriesSeason to Season class ToLocalString has also been altered to take in both season and year because lots of locales actually treat formatting seasons differently! most notably is Russian which adds a suffix at the end to notate seasons(??)
author Paper <paper@paper.us.eu.org>
date Thu, 13 Jun 2024 01:49:18 -0400
parents 657fda1b9cac
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
3
279
657fda1b9cac *: clean up enums
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
4 #include <array>
102
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
5
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
6 namespace Theme {
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
7
279
657fda1b9cac *: clean up enums
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
8 enum class Theme {
657fda1b9cac *: clean up enums
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
9 Default,
657fda1b9cac *: clean up enums
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
10 Light,
657fda1b9cac *: clean up enums
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
11 Dark
657fda1b9cac *: clean up enums
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
12 };
657fda1b9cac *: clean up enums
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
13
657fda1b9cac *: clean up enums
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
14 constexpr std::array<Theme, 3> Themes{
657fda1b9cac *: clean up enums
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
15 Theme::Default,
657fda1b9cac *: clean up enums
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
16 Theme::Light,
657fda1b9cac *: clean up enums
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
17 Theme::Dark
657fda1b9cac *: clean up enums
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
18 };
657fda1b9cac *: clean up enums
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
19
657fda1b9cac *: clean up enums
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
20 class ThemeManager final {
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 118
diff changeset
21 public:
279
657fda1b9cac *: clean up enums
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
22 ThemeManager(Theme theme = Theme::Default);
657fda1b9cac *: clean up enums
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
23 void SetTheme(Theme theme);
657fda1b9cac *: clean up enums
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
24 Theme GetTheme() const;
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 118
diff changeset
25 bool IsInDarkTheme() const;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 118
diff changeset
26 void RepaintCurrentTheme();
102
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
27
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 118
diff changeset
28 private:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 118
diff changeset
29 void SetToDarkTheme();
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 118
diff changeset
30 void SetToLightTheme();
279
657fda1b9cac *: clean up enums
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
31 void SetStyleSheet(Theme theme);
657fda1b9cac *: clean up enums
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
32 Theme GetCurrentOSTheme() const;
657fda1b9cac *: clean up enums
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
33 Theme theme;
102
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
34 };
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
35
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
36 } // namespace Theme
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
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_