91
|
1 #include "core/config.h"
|
|
2 #include "gui/translate/config.h"
|
|
3
|
202
|
4 #include <unordered_map>
|
|
5
|
91
|
6 namespace Translate {
|
|
7
|
|
8 Themes ToTheme(const std::string& theme) {
|
|
9 const std::unordered_map<std::string, Themes> map = {
|
258
|
10 {"Default", Themes::OS },
|
|
11 {"Light", Themes::LIGHT},
|
|
12 {"Dark", Themes::DARK }
|
|
13 };
|
91
|
14
|
|
15 if (map.find(theme) == map.end())
|
|
16 return Themes::OS;
|
|
17 return map.at(theme);
|
|
18 }
|
|
19
|
|
20 std::string ToString(const Themes& theme) {
|
|
21 switch (theme) {
|
|
22 default:
|
258
|
23 case Themes::OS: return "Default";
|
91
|
24 case Themes::LIGHT: return "Light";
|
258
|
25 case Themes::DARK: return "Dark";
|
91
|
26 }
|
|
27 }
|
|
28
|
258
|
29 } // namespace Translate
|