[Theming] Support new declaration for variables ( <variable name="xx" value="xx"> ) Older declarations are unchanged.

This commit is contained in:
Fabrice CARUSO
2026-03-10 20:43:21 +01:00
committed by Douglas Teles
parent 33f29c5d94
commit eabb425fdd
+7 -1
View File
@@ -765,7 +765,7 @@ void ThemeData::loadFile(const std::string& system, const std::map<std::string,
mVariables["themePath"] = Utils::FileSystem::getParent(mPaths.back());
mVariables["region"] = mRegion;
mVariables["root"] = Utils::FileSystem::getParent(mPaths.back());
for (auto name : Settings::getInstance()->getSettingsNames())
{
if (name.find(".") != std::string::npos)
@@ -1188,6 +1188,12 @@ void ThemeData::parseVariable(const pugi::xml_node& node)
std::string val = node.text().as_string();
if (key == "variable" && node.attribute("name") && node.attribute("value"))
{
key = node.attribute("name").as_string();
val = resolvePlaceholders(node.attribute("value").as_string());
}
if (val == "true" || val == "false")
{
mVariables[key] = val;