annotate src/gui/translate/config.cc @ 91:29e2840d9b7b

*: oops
author Paper <mrpapersonic@gmail.com>
date Tue, 31 Oct 2023 23:56:10 -0400
parents
children 71832ffe425a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
91
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
1 #include "core/config.h"
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
2 #include "gui/translate/config.h"
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
3
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
4 namespace Translate {
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
5
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
6 Themes ToTheme(const std::string& theme) {
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
7 const std::unordered_map<std::string, Themes> map = {
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
8 {"Default", Themes::OS },
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
9 {"Light", Themes::LIGHT},
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
10 {"Dark", Themes::DARK }
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
11 };
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
12
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
13 if (map.find(theme) == map.end())
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
14 return Themes::OS;
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
15 return map.at(theme);
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
16 }
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
17
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
18 std::string ToString(const Themes& theme) {
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
19 switch (theme) {
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
20 default:
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
21 case Themes::OS: return "Default";
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
22 case Themes::LIGHT: return "Light";
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
23 case Themes::DARK: return "Dark";
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
24 }
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
25 }
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
26
29e2840d9b7b *: oops
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
27 }