mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 06:05:38 +00:00
Modified and added some variables and properties to support better letter case controls for collection names.
This commit is contained in:
parent
918ffd9b9e
commit
f2fd8cf6a8
|
@ -1328,13 +1328,37 @@ void SystemData::loadTheme(ThemeTriggers::TriggerType trigger)
|
|||
sysData.insert(std::pair<std::string, std::string>("system.name", getName()));
|
||||
sysData.insert(std::pair<std::string, std::string>("system.theme", getThemeFolder()));
|
||||
sysData.insert(std::pair<std::string, std::string>("system.fullName", getFullName()));
|
||||
if (isCollection()) {
|
||||
if (isCollection() && isCustomCollection()) {
|
||||
sysData.insert(
|
||||
std::pair<std::string, std::string>("system.name.collections", getName()));
|
||||
std::pair<std::string, std::string>("system.name.customCollections", getName()));
|
||||
sysData.insert(std::pair<std::string, std::string>("system.fullName.customCollections",
|
||||
getFullName()));
|
||||
sysData.insert(std::pair<std::string, std::string>("system.theme.customCollections",
|
||||
getThemeFolder()));
|
||||
sysData.insert(
|
||||
std::pair<std::string, std::string>("system.fullName.collections", getFullName()));
|
||||
std::pair<std::string, std::string>("system.name.autoCollections", "\b"));
|
||||
sysData.insert(
|
||||
std::pair<std::string, std::string>("system.theme.collections", getThemeFolder()));
|
||||
std::pair<std::string, std::string>("system.fullName.autoCollections", "\b"));
|
||||
sysData.insert(
|
||||
std::pair<std::string, std::string>("system.theme.autoCollections", "\b"));
|
||||
sysData.insert(std::pair<std::string, std::string>("system.name.noCollections", "\b"));
|
||||
sysData.insert(
|
||||
std::pair<std::string, std::string>("system.fullName.noCollections", "\b"));
|
||||
sysData.insert(std::pair<std::string, std::string>("system.theme.noCollections", "\b"));
|
||||
}
|
||||
else if (isCollection()) {
|
||||
sysData.insert(
|
||||
std::pair<std::string, std::string>("system.name.autoCollections", getName()));
|
||||
sysData.insert(std::pair<std::string, std::string>("system.fullName.autoCollections",
|
||||
getFullName()));
|
||||
sysData.insert(std::pair<std::string, std::string>("system.theme.autoCollections",
|
||||
getThemeFolder()));
|
||||
sysData.insert(
|
||||
std::pair<std::string, std::string>("system.name.customCollections", "\b"));
|
||||
sysData.insert(
|
||||
std::pair<std::string, std::string>("system.fullName.customCollections", "\b"));
|
||||
sysData.insert(
|
||||
std::pair<std::string, std::string>("system.theme.customCollections", "\b"));
|
||||
sysData.insert(std::pair<std::string, std::string>("system.name.noCollections", "\b"));
|
||||
sysData.insert(
|
||||
std::pair<std::string, std::string>("system.fullName.noCollections", "\b"));
|
||||
|
@ -1347,10 +1371,18 @@ void SystemData::loadTheme(ThemeTriggers::TriggerType trigger)
|
|||
getFullName()));
|
||||
sysData.insert(std::pair<std::string, std::string>("system.theme.noCollections",
|
||||
getThemeFolder()));
|
||||
sysData.insert(std::pair<std::string, std::string>("system.name.collections", "\b"));
|
||||
sysData.insert(
|
||||
std::pair<std::string, std::string>("system.fullName.collections", "\b"));
|
||||
sysData.insert(std::pair<std::string, std::string>("system.theme.collections", "\b"));
|
||||
std::pair<std::string, std::string>("system.name.autoCollections", "\b"));
|
||||
sysData.insert(
|
||||
std::pair<std::string, std::string>("system.fullName.autoCollections", "\b"));
|
||||
sysData.insert(
|
||||
std::pair<std::string, std::string>("system.theme.autoCollections", "\b"));
|
||||
sysData.insert(
|
||||
std::pair<std::string, std::string>("system.name.customCollections", "\b"));
|
||||
sysData.insert(
|
||||
std::pair<std::string, std::string>("system.fullName.customCollections", "\b"));
|
||||
sysData.insert(
|
||||
std::pair<std::string, std::string>("system.theme.customCollections", "\b"));
|
||||
}
|
||||
|
||||
mTheme->loadFile(sysData, path, trigger, isCustomCollection());
|
||||
|
|
|
@ -597,8 +597,8 @@ void GamelistBase::populateList(const std::vector<FileData*>& files, FileData* f
|
|||
mFirstGameEntry = (*it);
|
||||
|
||||
if (customCollection && (*it)->getType() == FOLDER) {
|
||||
letterCase = mPrimary->getLetterCaseGroupedCollections();
|
||||
if (letterCase == LetterCase::NONE)
|
||||
letterCase = mPrimary->getLetterCaseCustomCollections();
|
||||
if (letterCase == LetterCase::UNDEFINED)
|
||||
letterCase = mPrimary->getLetterCase();
|
||||
}
|
||||
else {
|
||||
|
@ -614,7 +614,7 @@ void GamelistBase::populateList(const std::vector<FileData*>& files, FileData* f
|
|||
carouselEntry.name = Utils::String::toUpper(carouselEntry.name);
|
||||
else if (letterCase == LetterCase::LOWERCASE)
|
||||
carouselEntry.name = Utils::String::toLower(carouselEntry.name);
|
||||
else if (letterCase == LetterCase::CAPITALIZED)
|
||||
else if (letterCase == LetterCase::CAPITALIZE)
|
||||
carouselEntry.name = Utils::String::toCapitalized(carouselEntry.name);
|
||||
|
||||
if (defaultImage != "")
|
||||
|
@ -631,7 +631,7 @@ void GamelistBase::populateList(const std::vector<FileData*>& files, FileData* f
|
|||
gridEntry.name = Utils::String::toUpper(gridEntry.name);
|
||||
else if (letterCase == LetterCase::LOWERCASE)
|
||||
gridEntry.name = Utils::String::toLower(gridEntry.name);
|
||||
else if (letterCase == LetterCase::CAPITALIZED)
|
||||
else if (letterCase == LetterCase::CAPITALIZE)
|
||||
gridEntry.name = Utils::String::toCapitalized(gridEntry.name);
|
||||
|
||||
if (defaultImage != "")
|
||||
|
@ -695,7 +695,7 @@ void GamelistBase::populateList(const std::vector<FileData*>& files, FileData* f
|
|||
name = Utils::String::toUpper(name);
|
||||
else if (letterCase == LetterCase::LOWERCASE)
|
||||
name = Utils::String::toLower(name);
|
||||
else if (letterCase == LetterCase::CAPITALIZED)
|
||||
else if (letterCase == LetterCase::CAPITALIZE)
|
||||
name = Utils::String::toCapitalized(name);
|
||||
|
||||
textListEntry.name = name;
|
||||
|
@ -735,7 +735,7 @@ void GamelistBase::addPlaceholder(FileData* firstEntry)
|
|||
name = Utils::String::toUpper(name);
|
||||
else if (letterCase == LetterCase::LOWERCASE)
|
||||
name = Utils::String::toLower(name);
|
||||
else if (letterCase == LetterCase::CAPITALIZED)
|
||||
else if (letterCase == LetterCase::CAPITALIZE)
|
||||
name = Utils::String::toCapitalized(name);
|
||||
};
|
||||
|
||||
|
|
|
@ -762,9 +762,14 @@ void SystemView::populate()
|
|||
|
||||
auto letterCaseFunc = [&it, this](std::string& name) {
|
||||
LetterCase letterCase {LetterCase::NONE};
|
||||
if (it->isCollection()) {
|
||||
letterCase = mPrimary->getLetterCaseCollections();
|
||||
if (letterCase == LetterCase::NONE)
|
||||
if (it->isCustomCollection()) {
|
||||
letterCase = mPrimary->getLetterCaseCustomCollections();
|
||||
if (letterCase == LetterCase::UNDEFINED)
|
||||
letterCase = mPrimary->getLetterCase();
|
||||
}
|
||||
else if (it->isCollection()) {
|
||||
letterCase = mPrimary->getLetterCaseAutoCollections();
|
||||
if (letterCase == LetterCase::UNDEFINED)
|
||||
letterCase = mPrimary->getLetterCase();
|
||||
}
|
||||
else {
|
||||
|
@ -775,7 +780,7 @@ void SystemView::populate()
|
|||
name = Utils::String::toUpper(name);
|
||||
else if (letterCase == LetterCase::LOWERCASE)
|
||||
name = Utils::String::toLower(name);
|
||||
else if (letterCase == LetterCase::CAPITALIZED)
|
||||
else if (letterCase == LetterCase::CAPITALIZE)
|
||||
name = Utils::String::toCapitalized(name);
|
||||
};
|
||||
|
||||
|
|
|
@ -60,8 +60,9 @@ enum Alignment {
|
|||
enum class LetterCase {
|
||||
UPPERCASE,
|
||||
LOWERCASE,
|
||||
CAPITALIZED,
|
||||
NONE
|
||||
CAPITALIZE,
|
||||
NONE,
|
||||
UNDEFINED
|
||||
};
|
||||
|
||||
class GuiComponent
|
||||
|
|
|
@ -179,8 +179,8 @@ std::map<std::string, std::map<std::string, ThemeData::ElementPropertyType>>
|
|||
{"fontPath", PATH},
|
||||
{"fontSize", FLOAT},
|
||||
{"letterCase", STRING},
|
||||
{"letterCaseCollections", STRING},
|
||||
{"letterCaseGroupedCollections", STRING},
|
||||
{"letterCaseAutoCollections", STRING},
|
||||
{"letterCaseCustomCollections", STRING},
|
||||
{"lineSpacing", FLOAT},
|
||||
{"fadeAbovePrimary", BOOLEAN},
|
||||
{"zIndex", FLOAT},
|
||||
|
@ -224,8 +224,8 @@ std::map<std::string, std::map<std::string, ThemeData::ElementPropertyType>>
|
|||
{"fontPath", PATH},
|
||||
{"fontSize", FLOAT},
|
||||
{"letterCase", STRING},
|
||||
{"letterCaseCollections", STRING},
|
||||
{"letterCaseGroupedCollections", STRING},
|
||||
{"letterCaseAutoCollections", STRING},
|
||||
{"letterCaseCustomCollections", STRING},
|
||||
{"lineSpacing", FLOAT},
|
||||
{"fadeAbovePrimary", BOOLEAN},
|
||||
{"zIndex", FLOAT}}},
|
||||
|
@ -253,8 +253,8 @@ std::map<std::string, std::map<std::string, ThemeData::ElementPropertyType>>
|
|||
{"alignment", STRING}, // For backward compatibility with legacy themes.
|
||||
{"horizontalMargin", FLOAT},
|
||||
{"letterCase", STRING},
|
||||
{"letterCaseCollections", STRING},
|
||||
{"letterCaseGroupedCollections", STRING},
|
||||
{"letterCaseAutoCollections", STRING},
|
||||
{"letterCaseCustomCollections", STRING},
|
||||
{"forceUppercase", BOOLEAN}, // For backward compatibility with legacy themes.
|
||||
{"lineSpacing", FLOAT},
|
||||
{"indicators", STRING},
|
||||
|
@ -1853,7 +1853,7 @@ void ThemeData::parseElement(const pugi::xml_node& root,
|
|||
std::string str {resolvePlaceholders(node.text().as_string())};
|
||||
|
||||
// Handle the special case with mutually exclusive system variables, for example
|
||||
// system.fullName.collections and system.fullName.noCollections which can never
|
||||
// system.fullName.autoCollections and system.fullName.noCollections which can never
|
||||
// exist at the same time. A backspace is assigned in SystemData to flag the
|
||||
// variables that do not apply and if it's encountered here we simply skip the
|
||||
// property.
|
||||
|
|
|
@ -65,10 +65,13 @@ public:
|
|||
void setDefaultImage(std::string defaultImage) { mDefaultImage = defaultImage; }
|
||||
bool isScrolling() const override { return List::isScrolling(); }
|
||||
const LetterCase getLetterCase() const override { return mLetterCase; }
|
||||
const LetterCase getLetterCaseCollections() const override { return mLetterCaseCollections; }
|
||||
const LetterCase getLetterCaseGroupedCollections() const override
|
||||
const LetterCase getLetterCaseAutoCollections() const override
|
||||
{
|
||||
return mLetterCaseGroupedCollections;
|
||||
return mLetterCaseAutoCollections;
|
||||
}
|
||||
const LetterCase getLetterCaseCustomCollections() const override
|
||||
{
|
||||
return mLetterCaseCustomCollections;
|
||||
}
|
||||
|
||||
void setCancelTransitionsCallback(const std::function<void()>& func) override
|
||||
|
@ -170,8 +173,8 @@ private:
|
|||
unsigned int mTextBackgroundColor;
|
||||
std::shared_ptr<Font> mFont;
|
||||
LetterCase mLetterCase;
|
||||
LetterCase mLetterCaseCollections;
|
||||
LetterCase mLetterCaseGroupedCollections;
|
||||
LetterCase mLetterCaseAutoCollections;
|
||||
LetterCase mLetterCaseCustomCollections;
|
||||
float mLineSpacing;
|
||||
bool mFadeAbovePrimary;
|
||||
};
|
||||
|
@ -227,8 +230,8 @@ CarouselComponent<T>::CarouselComponent()
|
|||
, mTextBackgroundColor {0xFFFFFF00}
|
||||
, mFont {Font::get(FONT_SIZE_LARGE)}
|
||||
, mLetterCase {LetterCase::NONE}
|
||||
, mLetterCaseCollections {LetterCase::NONE}
|
||||
, mLetterCaseGroupedCollections {LetterCase::NONE}
|
||||
, mLetterCaseAutoCollections {LetterCase::UNDEFINED}
|
||||
, mLetterCaseCustomCollections {LetterCase::UNDEFINED}
|
||||
, mLineSpacing {1.5f}
|
||||
, mFadeAbovePrimary {false}
|
||||
{
|
||||
|
@ -1555,7 +1558,7 @@ void CarouselComponent<T>::applyTheme(const std::shared_ptr<ThemeData>& theme,
|
|||
mLetterCase = LetterCase::LOWERCASE;
|
||||
}
|
||||
else if (letterCase == "capitalize") {
|
||||
mLetterCase = LetterCase::CAPITALIZED;
|
||||
mLetterCase = LetterCase::CAPITALIZE;
|
||||
}
|
||||
else if (letterCase != "none") {
|
||||
LOG(LogWarning) << "CarouselComponent: Invalid theme configuration, property "
|
||||
|
@ -1564,40 +1567,46 @@ void CarouselComponent<T>::applyTheme(const std::shared_ptr<ThemeData>& theme,
|
|||
}
|
||||
}
|
||||
|
||||
if (elem->has("letterCaseCollections")) {
|
||||
const std::string& letterCase {elem->get<std::string>("letterCaseCollections")};
|
||||
if (elem->has("letterCaseAutoCollections")) {
|
||||
const std::string& letterCase {elem->get<std::string>("letterCaseAutoCollections")};
|
||||
|
||||
if (letterCase == "uppercase") {
|
||||
mLetterCaseCollections = LetterCase::UPPERCASE;
|
||||
mLetterCaseAutoCollections = LetterCase::UPPERCASE;
|
||||
}
|
||||
else if (letterCase == "lowercase") {
|
||||
mLetterCaseCollections = LetterCase::LOWERCASE;
|
||||
mLetterCaseAutoCollections = LetterCase::LOWERCASE;
|
||||
}
|
||||
else if (letterCase == "capitalize") {
|
||||
mLetterCaseCollections = LetterCase::CAPITALIZED;
|
||||
mLetterCaseAutoCollections = LetterCase::CAPITALIZE;
|
||||
}
|
||||
else if (letterCase == "none") {
|
||||
mLetterCaseAutoCollections = LetterCase::NONE;
|
||||
}
|
||||
else {
|
||||
LOG(LogWarning) << "CarouselComponent: Invalid theme configuration, property "
|
||||
"\"letterCaseCollections\" for element \""
|
||||
"\"letterCaseAutoCollections\" for element \""
|
||||
<< element.substr(9) << "\" defined as \"" << letterCase << "\"";
|
||||
}
|
||||
}
|
||||
|
||||
if (elem->has("letterCaseGroupedCollections")) {
|
||||
const std::string& letterCase {elem->get<std::string>("letterCaseGroupedCollections")};
|
||||
if (elem->has("letterCaseCustomCollections")) {
|
||||
const std::string& letterCase {elem->get<std::string>("letterCaseCustomCollections")};
|
||||
|
||||
if (letterCase == "uppercase") {
|
||||
mLetterCaseGroupedCollections = LetterCase::UPPERCASE;
|
||||
mLetterCaseCustomCollections = LetterCase::UPPERCASE;
|
||||
}
|
||||
else if (letterCase == "lowercase") {
|
||||
mLetterCaseGroupedCollections = LetterCase::LOWERCASE;
|
||||
mLetterCaseCustomCollections = LetterCase::LOWERCASE;
|
||||
}
|
||||
else if (letterCase == "capitalize") {
|
||||
mLetterCaseGroupedCollections = LetterCase::CAPITALIZED;
|
||||
mLetterCaseCustomCollections = LetterCase::CAPITALIZE;
|
||||
}
|
||||
else if (letterCase == "none") {
|
||||
mLetterCaseCustomCollections = LetterCase::NONE;
|
||||
}
|
||||
else {
|
||||
LOG(LogWarning) << "CarouselComponent: Invalid theme configuration, property "
|
||||
"\"letterCaseGroupedCollections\" for element \""
|
||||
"\"letterCaseCustomCollections\" for element \""
|
||||
<< element.substr(9) << "\" defined as \"" << letterCase << "\"";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,10 +58,13 @@ public:
|
|||
const size_t getNumEntries() override { return mEntries.size(); }
|
||||
const bool getFadeAbovePrimary() const override { return mFadeAbovePrimary; }
|
||||
const LetterCase getLetterCase() const override { return mLetterCase; }
|
||||
const LetterCase getLetterCaseCollections() const override { return mLetterCaseCollections; }
|
||||
const LetterCase getLetterCaseGroupedCollections() const override
|
||||
const LetterCase getLetterCaseAutoCollections() const override
|
||||
{
|
||||
return mLetterCaseGroupedCollections;
|
||||
return mLetterCaseAutoCollections;
|
||||
}
|
||||
const LetterCase getLetterCaseCustomCollections() const override
|
||||
{
|
||||
return mLetterCaseCustomCollections;
|
||||
}
|
||||
const std::string& getDefaultGridImage() const { return mDefaultImage; }
|
||||
void setDefaultImage(std::string defaultImage) { mDefaultImage = defaultImage; }
|
||||
|
@ -170,8 +173,8 @@ private:
|
|||
unsigned int mTextBackgroundColor;
|
||||
std::shared_ptr<Font> mFont;
|
||||
LetterCase mLetterCase;
|
||||
LetterCase mLetterCaseCollections;
|
||||
LetterCase mLetterCaseGroupedCollections;
|
||||
LetterCase mLetterCaseAutoCollections;
|
||||
LetterCase mLetterCaseCustomCollections;
|
||||
float mLineSpacing;
|
||||
bool mFadeAbovePrimary;
|
||||
};
|
||||
|
@ -223,8 +226,8 @@ GridComponent<T>::GridComponent()
|
|||
, mTextColor {0x000000FF}
|
||||
, mTextBackgroundColor {0xFFFFFF00}
|
||||
, mLetterCase {LetterCase::NONE}
|
||||
, mLetterCaseCollections {LetterCase::NONE}
|
||||
, mLetterCaseGroupedCollections {LetterCase::NONE}
|
||||
, mLetterCaseAutoCollections {LetterCase::UNDEFINED}
|
||||
, mLetterCaseCustomCollections {LetterCase::UNDEFINED}
|
||||
, mLineSpacing {1.5f}
|
||||
, mFadeAbovePrimary {false}
|
||||
{
|
||||
|
@ -1124,7 +1127,7 @@ void GridComponent<T>::applyTheme(const std::shared_ptr<ThemeData>& theme,
|
|||
mLetterCase = LetterCase::LOWERCASE;
|
||||
}
|
||||
else if (letterCase == "capitalize") {
|
||||
mLetterCase = LetterCase::CAPITALIZED;
|
||||
mLetterCase = LetterCase::CAPITALIZE;
|
||||
}
|
||||
else if (letterCase != "none") {
|
||||
LOG(LogWarning) << "GridComponent: Invalid theme configuration, property "
|
||||
|
@ -1133,40 +1136,46 @@ void GridComponent<T>::applyTheme(const std::shared_ptr<ThemeData>& theme,
|
|||
}
|
||||
}
|
||||
|
||||
if (elem->has("letterCaseCollections")) {
|
||||
const std::string& letterCase {elem->get<std::string>("letterCaseCollections")};
|
||||
if (elem->has("letterCaseAutoCollections")) {
|
||||
const std::string& letterCase {elem->get<std::string>("letterCaseAutoCollections")};
|
||||
|
||||
if (letterCase == "uppercase") {
|
||||
mLetterCaseCollections = LetterCase::UPPERCASE;
|
||||
mLetterCaseAutoCollections = LetterCase::UPPERCASE;
|
||||
}
|
||||
else if (letterCase == "lowercase") {
|
||||
mLetterCaseCollections = LetterCase::LOWERCASE;
|
||||
mLetterCaseAutoCollections = LetterCase::LOWERCASE;
|
||||
}
|
||||
else if (letterCase == "capitalize") {
|
||||
mLetterCaseCollections = LetterCase::CAPITALIZED;
|
||||
mLetterCaseAutoCollections = LetterCase::CAPITALIZE;
|
||||
}
|
||||
else if (letterCase == "none") {
|
||||
mLetterCaseAutoCollections = LetterCase::NONE;
|
||||
}
|
||||
else {
|
||||
LOG(LogWarning) << "GridComponent: Invalid theme configuration, property "
|
||||
"\"letterCaseCollections\" for element \""
|
||||
"\"letterCaseAutoCollections\" for element \""
|
||||
<< element.substr(5) << "\" defined as \"" << letterCase << "\"";
|
||||
}
|
||||
}
|
||||
|
||||
if (elem->has("letterCaseGroupedCollections")) {
|
||||
const std::string& letterCase {elem->get<std::string>("letterCaseGroupedCollections")};
|
||||
if (elem->has("letterCaseCustomCollections")) {
|
||||
const std::string& letterCase {elem->get<std::string>("letterCaseCustomCollections")};
|
||||
|
||||
if (letterCase == "uppercase") {
|
||||
mLetterCaseGroupedCollections = LetterCase::UPPERCASE;
|
||||
mLetterCaseCustomCollections = LetterCase::UPPERCASE;
|
||||
}
|
||||
else if (letterCase == "lowercase") {
|
||||
mLetterCaseGroupedCollections = LetterCase::LOWERCASE;
|
||||
mLetterCaseCustomCollections = LetterCase::LOWERCASE;
|
||||
}
|
||||
else if (letterCase == "capitalize") {
|
||||
mLetterCaseGroupedCollections = LetterCase::CAPITALIZED;
|
||||
mLetterCaseCustomCollections = LetterCase::CAPITALIZE;
|
||||
}
|
||||
else if (letterCase == "none") {
|
||||
mLetterCaseCustomCollections = LetterCase::NONE;
|
||||
}
|
||||
else {
|
||||
LOG(LogWarning) << "GridComponent: Invalid theme configuration, property "
|
||||
"\"letterCaseGroupedCollections\" for element \""
|
||||
"\"letterCaseCustomCollections\" for element \""
|
||||
<< element.substr(5) << "\" defined as \"" << letterCase << "\"";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,8 +45,8 @@ public:
|
|||
virtual const size_t getNumEntries() = 0;
|
||||
virtual const bool getFadeAbovePrimary() const = 0;
|
||||
virtual const LetterCase getLetterCase() const = 0;
|
||||
virtual const LetterCase getLetterCaseCollections() const = 0;
|
||||
virtual const LetterCase getLetterCaseGroupedCollections() const = 0;
|
||||
virtual const LetterCase getLetterCaseAutoCollections() const = 0;
|
||||
virtual const LetterCase getLetterCaseCustomCollections() const = 0;
|
||||
|
||||
// Functions used by some primary components.
|
||||
virtual void onDemandTextureLoad() {}
|
||||
|
|
|
@ -76,10 +76,13 @@ public:
|
|||
const std::string& getIndicators() const { return mIndicators; }
|
||||
const std::string& getCollectionIndicators() const { return mCollectionIndicators; }
|
||||
const LetterCase getLetterCase() const override { return mLetterCase; }
|
||||
const LetterCase getLetterCaseCollections() const override { return mLetterCaseCollections; }
|
||||
const LetterCase getLetterCaseGroupedCollections() const override
|
||||
const LetterCase getLetterCaseAutoCollections() const override
|
||||
{
|
||||
return mLetterCaseGroupedCollections;
|
||||
return mLetterCaseAutoCollections;
|
||||
}
|
||||
const LetterCase getLetterCaseCustomCollections() const override
|
||||
{
|
||||
return mLetterCaseCustomCollections;
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -133,8 +136,8 @@ private:
|
|||
bool mLegacyMode;
|
||||
bool mFadeAbovePrimary;
|
||||
LetterCase mLetterCase;
|
||||
LetterCase mLetterCaseCollections;
|
||||
LetterCase mLetterCaseGroupedCollections;
|
||||
LetterCase mLetterCaseAutoCollections;
|
||||
LetterCase mLetterCaseCustomCollections;
|
||||
float mLineSpacing;
|
||||
float mSelectorHeight;
|
||||
float mSelectorHorizontalOffset;
|
||||
|
@ -169,8 +172,8 @@ TextListComponent<T>::TextListComponent()
|
|||
, mLegacyMode {false}
|
||||
, mFadeAbovePrimary {false}
|
||||
, mLetterCase {LetterCase::NONE}
|
||||
, mLetterCaseCollections {LetterCase::NONE}
|
||||
, mLetterCaseGroupedCollections {LetterCase::NONE}
|
||||
, mLetterCaseAutoCollections {LetterCase::UNDEFINED}
|
||||
, mLetterCaseCustomCollections {LetterCase::UNDEFINED}
|
||||
, mLineSpacing {1.5f}
|
||||
, mSelectorHeight {mFont->getSize() * 1.5f}
|
||||
, mSelectorHorizontalOffset {0.0f}
|
||||
|
@ -597,7 +600,7 @@ void TextListComponent<T>::applyTheme(const std::shared_ptr<ThemeData>& theme,
|
|||
mLetterCase = LetterCase::LOWERCASE;
|
||||
}
|
||||
else if (letterCase == "capitalize") {
|
||||
mLetterCase = LetterCase::CAPITALIZED;
|
||||
mLetterCase = LetterCase::CAPITALIZE;
|
||||
}
|
||||
else if (letterCase != "none") {
|
||||
LOG(LogWarning) << "TextListComponent: Invalid theme configuration, property "
|
||||
|
@ -606,38 +609,44 @@ void TextListComponent<T>::applyTheme(const std::shared_ptr<ThemeData>& theme,
|
|||
}
|
||||
}
|
||||
|
||||
if (properties & LETTER_CASE && elem->has("letterCaseCollections")) {
|
||||
const std::string& letterCase {elem->get<std::string>("letterCaseCollections")};
|
||||
if (properties & LETTER_CASE && elem->has("letterCaseAutoCollections")) {
|
||||
const std::string& letterCase {elem->get<std::string>("letterCaseAutoCollections")};
|
||||
if (letterCase == "uppercase") {
|
||||
mLetterCaseCollections = LetterCase::UPPERCASE;
|
||||
mLetterCaseAutoCollections = LetterCase::UPPERCASE;
|
||||
}
|
||||
else if (letterCase == "lowercase") {
|
||||
mLetterCaseCollections = LetterCase::LOWERCASE;
|
||||
mLetterCaseAutoCollections = LetterCase::LOWERCASE;
|
||||
}
|
||||
else if (letterCase == "capitalize") {
|
||||
mLetterCaseCollections = LetterCase::CAPITALIZED;
|
||||
mLetterCaseAutoCollections = LetterCase::CAPITALIZE;
|
||||
}
|
||||
else if (letterCase == "none") {
|
||||
mLetterCaseAutoCollections = LetterCase::NONE;
|
||||
}
|
||||
else {
|
||||
LOG(LogWarning) << "TextListComponent: Invalid theme configuration, property "
|
||||
"\"letterCaseCollections\" for element \""
|
||||
"\"letterCaseAutoCollections\" for element \""
|
||||
<< element.substr(9) << "\" defined as \"" << letterCase << "\"";
|
||||
}
|
||||
}
|
||||
|
||||
if (properties & LETTER_CASE && elem->has("letterCaseGroupedCollections")) {
|
||||
const std::string& letterCase {elem->get<std::string>("letterCaseGroupedCollections")};
|
||||
if (properties & LETTER_CASE && elem->has("letterCaseCustomCollections")) {
|
||||
const std::string& letterCase {elem->get<std::string>("letterCaseCustomCollections")};
|
||||
if (letterCase == "uppercase") {
|
||||
mLetterCaseGroupedCollections = LetterCase::UPPERCASE;
|
||||
mLetterCaseCustomCollections = LetterCase::UPPERCASE;
|
||||
}
|
||||
else if (letterCase == "lowercase") {
|
||||
mLetterCaseGroupedCollections = LetterCase::LOWERCASE;
|
||||
mLetterCaseCustomCollections = LetterCase::LOWERCASE;
|
||||
}
|
||||
else if (letterCase == "capitalize") {
|
||||
mLetterCaseGroupedCollections = LetterCase::CAPITALIZED;
|
||||
mLetterCaseCustomCollections = LetterCase::CAPITALIZE;
|
||||
}
|
||||
else if (letterCase == "none") {
|
||||
mLetterCaseCustomCollections = LetterCase::NONE;
|
||||
}
|
||||
else {
|
||||
LOG(LogWarning) << "TextListComponent: Invalid theme configuration, property "
|
||||
"\"letterCaseGroupedCollections\" for element \""
|
||||
"\"letterCaseCustomCollections\" for element \""
|
||||
<< element.substr(9) << "\" defined as \"" << letterCase << "\"";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue