annotate include/gui/theme.h @ 102:b315f3759c56

*: big patch 1. use a wrapper for mINI that enables case sensitivity (personal preference) 2. rename dark_theme.cc to theme.cc and change it to be a class 3. include the "dep" folder so we don't have stupidity in json.h or ini.h 4. I think the graph was also tweaked a lot in this, nothing is constexpr and size is found at runtime...
author Paper <mrpapersonic@gmail.com>
date Fri, 03 Nov 2023 21:32:52 -0400
parents
children 6d8da6e64d61
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
102
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
1 #ifndef __gui__theme_h
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
2 #define __gui__theme_h
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
3
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
4 #include <QStyle>
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
5
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
6 enum class Themes {
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
7 OS,
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
8 LIGHT,
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
9 DARK
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
10 };
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
11
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
12 namespace Theme {
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
13
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
14 class Theme final {
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
15 public:
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
16 Theme(Themes theme = Themes::OS);
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
17 void SetTheme(Themes theme);
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
18 Themes GetTheme();
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
19
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
20 private:
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
21 bool IsInDarkMode();
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
22 void SetToDarkTheme();
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
23 void SetToLightTheme();
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
24 void SetStyleSheet(Themes theme);
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
25 Themes GetCurrentOSTheme();
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
26 Themes theme;
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
27 };
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
28
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
29 } // namespace Theme
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
30
b315f3759c56 *: big patch
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
31 #endif // __gui__theme_h