Added support for using the systemNameSuffix property together with scrollable text containers

This commit is contained in:
Leon Styhre 2023-04-20 17:01:36 +02:00
parent ac272bc944
commit e00967acfa

View file

@ -888,7 +888,25 @@ void GamelistView::updateView(const CursorState& state)
continue;
}
text->setValue(getMetadataValue());
if (metadata == "name" && file->getSystem()->isCollection() &&
text->getSystemNameSuffix()) {
const LetterCase letterCase {text->getLetterCaseSystemNameSuffix()};
std::string suffix {" ["};
if (letterCase == LetterCase::UPPERCASE)
suffix.append(
Utils::String::toUpper(file->getSourceFileData()->getSystem()->getName()));
else if (letterCase == LetterCase::CAPITALIZE)
suffix.append(Utils::String::toCapitalized(
file->getSourceFileData()->getSystem()->getName()));
else
suffix.append(file->getSourceFileData()->getSystem()->getName());
suffix.append("]");
text->setValue(getMetadataValue() + suffix);
}
else {
text->setValue(getMetadataValue());
}
}
for (auto& text : mTextComponents) {