X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=bigscreen%2Ftheme.cpp;h=03a26c1c56c45776f7df2835f68068ff8f5f5d43;hb=cad5aff5a3a21bb8c95d8a265e93687234f46a43;hp=008c37fbffa4303dfdd9d43837c568ad7c125a9a;hpb=bbbf0f34d43aa3b6f43225fb6c2d45566a423ab1;p=ccbs diff --git a/bigscreen/theme.cpp b/bigscreen/theme.cpp index 008c37f..03a26c1 100644 --- a/bigscreen/theme.cpp +++ b/bigscreen/theme.cpp @@ -57,6 +57,14 @@ std::string get_theme_config(const std::string &key, const std::string subkey) return config[key + "." + subkey]; } + std::string modkey = key; + while (modkey.find_last_of(".") != std::string::npos) { + modkey.resize(modkey.find_last_of(".")); + if (config.count(modkey + "." + subkey)) { + return config[modkey + "." + subkey]; + } + } + return config["default." + subkey]; } @@ -68,9 +76,9 @@ void fill_background(unsigned char *buf, unsigned width, unsigned height) unsigned char *ptr = buf; for (unsigned i = 0; i < width * height; ++i) { - *ptr++ = bg_r; - *ptr++ = bg_g; *ptr++ = bg_b; + *ptr++ = bg_g; + *ptr++ = bg_r; *ptr++ = 0; } }