Mercurial > minori
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/gui/translate/config.cc Tue Oct 31 23:56:10 2023 -0400 @@ -0,0 +1,27 @@ +#include "core/config.h" +#include "gui/translate/config.h" + +namespace Translate { + +Themes ToTheme(const std::string& theme) { + const std::unordered_map<std::string, Themes> map = { + {"Default", Themes::OS }, + {"Light", Themes::LIGHT}, + {"Dark", Themes::DARK } + }; + + if (map.find(theme) == map.end()) + return Themes::OS; + return map.at(theme); +} + +std::string ToString(const Themes& theme) { + switch (theme) { + default: + case Themes::OS: return "Default"; + case Themes::LIGHT: return "Light"; + case Themes::DARK: return "Dark"; + } +} + +}