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 }
|