]> git.sesse.net Git - ccbs/blobdiff - bigscreen/theme.cpp
Support different backgrounds per-screen.
[ccbs] / bigscreen / theme.cpp
index 542d2ada93faf271d6f00d63dbd36a48828b77cb..fb6f7707b450de93bedf9bc97cc91ad905dc0e19 100644 (file)
@@ -78,11 +78,12 @@ std::string get_theme_config(const std::string &key, const std::string subkey)
        return config["default." + subkey];
 }
 
-void fill_background(unsigned char *buf, unsigned width, unsigned height)
+void fill_background(unsigned char *buf, const std::string &screen_name, unsigned width, unsigned height)
 {
-       int bg_r = atoi(get_theme_config("background", "red").c_str());
-       int bg_g = atoi(get_theme_config("background", "green").c_str());
-       int bg_b = atoi(get_theme_config("background", "blue").c_str());
+       std::string key = "background." + screen_name;
+       int bg_r = atoi(get_theme_config(key, "red").c_str());
+       int bg_g = atoi(get_theme_config(key, "green").c_str());
+       int bg_b = atoi(get_theme_config(key, "blue").c_str());
 
        unsigned char *ptr = buf;
        for (unsigned i = 0; i < width * height; ++i) {