Mercurial > minori
annotate src/gui/translate/config.cc @ 166:54c5d80a737e
dep/animia: add libutil method
I changed the "linux" method to be "proc", because it isn't exactly Linux specific
this commit also has some changes to the x11 stuff:
instead of enumerating over only top-level windows, we iterate over ALL of them
this is because many X11 apps actually use multiple windows
for some reason, I still can't get it to work with VLC, but it picks up Firefox...
author | paper@DavesDouble.local |
---|---|
date | Sun, 19 Nov 2023 04:21:56 -0500 |
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 } |