Added support for the 'metadata' element to TextComponent and DateTimeComponent.

This commit is contained in:
Leon Styhre 2022-01-22 21:24:19 +01:00
parent 6229592c74
commit 487422454e
2 changed files with 6 additions and 0 deletions

View file

@ -145,6 +145,9 @@ void DateTimeComponent::applyTheme(const std::shared_ptr<ThemeData>& theme,
LOG(LogError) << "Unknown text alignment string: " << str; LOG(LogError) << "Unknown text alignment string: " << str;
} }
if (properties & METADATA && elem->has("metadata"))
setMetadataField(elem->get<std::string>("metadata"));
if (properties & FORCE_UPPERCASE && elem->has("forceUppercase")) if (properties & FORCE_UPPERCASE && elem->has("forceUppercase"))
setUppercase(elem->get<bool>("forceUppercase")); setUppercase(elem->get<bool>("forceUppercase"));

View file

@ -323,6 +323,9 @@ void TextComponent::applyTheme(const std::shared_ptr<ThemeData>& theme,
if (properties & TEXT && elem->has("text")) if (properties & TEXT && elem->has("text"))
setText(elem->get<std::string>("text")); setText(elem->get<std::string>("text"));
if (properties & METADATA && elem->has("metadata"))
setMetadataField(elem->get<std::string>("metadata"));
if (properties & FORCE_UPPERCASE && elem->has("forceUppercase")) if (properties & FORCE_UPPERCASE && elem->has("forceUppercase"))
setUppercase(elem->get<bool>("forceUppercase")); setUppercase(elem->get<bool>("forceUppercase"));