Mercurial > minori
annotate src/gui/translate/config.cc @ 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 | 29e2840d9b7b |
children | 71832ffe425a |
rev | line source |
---|---|
91 | 1 #include "core/config.h" |
2 #include "gui/translate/config.h" | |
3 | |
4 namespace Translate { | |
5 | |
6 Themes ToTheme(const std::string& theme) { | |
7 const std::unordered_map<std::string, Themes> map = { | |
8 {"Default", Themes::OS }, | |
9 {"Light", Themes::LIGHT}, | |
10 {"Dark", Themes::DARK } | |
11 }; | |
12 | |
13 if (map.find(theme) == map.end()) | |
14 return Themes::OS; | |
15 return map.at(theme); | |
16 } | |
17 | |
18 std::string ToString(const Themes& theme) { | |
19 switch (theme) { | |
20 default: | |
21 case Themes::OS: return "Default"; | |
22 case Themes::LIGHT: return "Light"; | |
23 case Themes::DARK: return "Dark"; | |
24 } | |
25 } | |
26 | |
27 } |