]> git.sesse.net Git - ccbs/blobdiff - bigscreen/theme.cpp
Support different theming for odd/even rows.
[ccbs] / bigscreen / theme.cpp
index 008c37fbffa4303dfdd9d43837c568ad7c125a9a..03a26c1c56c45776f7df2835f68068ff8f5f5d43 100644 (file)
@@ -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;
        }
 }