From e00967acfaf2cb899ca4a70be1cd37e4f088277c Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Thu, 20 Apr 2023 17:01:36 +0200 Subject: [PATCH] Added support for using the systemNameSuffix property together with scrollable text containers --- es-app/src/views/GamelistView.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/es-app/src/views/GamelistView.cpp b/es-app/src/views/GamelistView.cpp index f13a37354..49f61ea59 100644 --- a/es-app/src/views/GamelistView.cpp +++ b/es-app/src/views/GamelistView.cpp @@ -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) {