From 27936131f34a3590b360f460a5bb462f221eaaa6 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Fri, 28 Oct 2022 21:08:44 +0200 Subject: [PATCH] Added a special 'all' shortcut variant. --- es-core/src/ThemeData.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/es-core/src/ThemeData.cpp b/es-core/src/ThemeData.cpp index c54892dfd..9782de7ee 100644 --- a/es-core/src/ThemeData.cpp +++ b/es-core/src/ThemeData.cpp @@ -462,6 +462,8 @@ void ThemeData::loadFile(const std::map& sysDataMap, mSelectedVariant = Settings::getInstance()->getString("ThemeVariant"); else mSelectedVariant = mVariants.front(); + // Special shortcut variant to apply configuration to all defined variants. + mVariants.emplace_back("all"); } if (mCurrentThemeSet->second.capabilities.aspectRatios.size() > 0) { @@ -771,6 +773,11 @@ ThemeData::ThemeCapability ThemeData::parseThemeCapabilities(const std::string& << "Found tag without name attribute, ignoring entry in \"" << capFile << "\""; } + else if (name == "all") { + LOG(LogWarning) + << "Found tag using reserved name \"all\", ignoring entry in \"" + << capFile << "\""; + } else { readVariant.name = name; } @@ -985,7 +992,7 @@ void ThemeData::parseVariants(const pugi::xml_node& root) << "\" is not defined in capabilities.xml"; } - if (mSelectedVariant == viewKey) { + if (mSelectedVariant == viewKey || viewKey == "all") { parseVariables(node); parseIncludes(node); parseViews(node);