Moved the color scheme parsing even earlier to prevent potential issues.

This commit is contained in:
Leon Styhre 2022-10-31 21:50:54 +01:00
parent f1bd530963
commit 0d7468e9b4

View file

@ -494,6 +494,9 @@ void ThemeData::loadFile(const std::map<std::string, std::string>& sysDataMap,
} }
parseVariables(root); parseVariables(root);
if (!mLegacyTheme)
parseColorSchemes(root);
parseIncludes(root); parseIncludes(root);
parseViews(root); parseViews(root);
// For non-legacy themes this will simply check for the presence of a feature tag and throw // For non-legacy themes this will simply check for the presence of a feature tag and throw
@ -501,7 +504,6 @@ void ThemeData::loadFile(const std::map<std::string, std::string>& sysDataMap,
parseFeatures(root); parseFeatures(root);
if (!mLegacyTheme) { if (!mLegacyTheme) {
parseColorSchemes(root);
parseVariants(root); parseVariants(root);
parseAspectRatios(root); parseAspectRatios(root);
} }
@ -1012,6 +1014,9 @@ void ThemeData::parseIncludes(const pugi::xml_node& root)
throw error << ": Missing <theme> tag"; throw error << ": Missing <theme> tag";
parseVariables(theme); parseVariables(theme);
if (!mLegacyTheme)
parseColorSchemes(theme);
parseIncludes(theme); parseIncludes(theme);
parseViews(theme); parseViews(theme);
// For non-legacy themes this will simply check for the presence of a feature tag and throw // For non-legacy themes this will simply check for the presence of a feature tag and throw
@ -1019,7 +1024,6 @@ void ThemeData::parseIncludes(const pugi::xml_node& root)
parseFeatures(theme); parseFeatures(theme);
if (!mLegacyTheme) { if (!mLegacyTheme) {
parseColorSchemes(theme);
parseVariants(theme); parseVariants(theme);
parseAspectRatios(theme); parseAspectRatios(theme);
} }
@ -1123,11 +1127,10 @@ void ThemeData::parseColorSchemes(const pugi::xml_node& root)
<< "\" is not defined in capabilities.xml"; << "\" is not defined in capabilities.xml";
} }
if (mSelectedColorScheme == viewKey) { if (mSelectedColorScheme == viewKey)
parseVariables(node); parseVariables(node);
} }
} }
}
} }
void ThemeData::parseAspectRatios(const pugi::xml_node& root) void ThemeData::parseAspectRatios(const pugi::xml_node& root)