annotate include/gui/theme.h @ 337:a7d4e5107531

dep/animone: REFACTOR ALL THE THINGS 1: animone now has its own syntax divergent from anisthesia, making different platforms actually have their own sections 2: process names in animone are now called `comm' (this will probably break things). this is what its called in bsd/linux so I'm just going to use it everywhere 3: the X11 code now checks for the existence of a UTF-8 window title and passes it if available 4: ANYTHING THATS NOT LINUX IS 100% UNTESTED AND CAN AND WILL BREAK! I still actually need to test the bsd code. to be honest I'm probably going to move all of the bsds into separate files because they're all essentially different operating systems at this point
author Paper <paper@paper.us.eu.org>
date Wed, 19 Jun 2024 12:51:15 -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_