mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-03-06 14:27:43 +00:00
Made the text element 'defaultValue' property usable with metadata types systemName, systemFullname, sourceSystemName and sourceSystemFullname
This commit is contained in:
parent
0b33884baa
commit
24c3817aaa
|
@ -999,7 +999,7 @@ void GamelistView::updateView(const CursorState& state)
|
||||||
file->getPath() == file->getSystem()->getName()) &&
|
file->getPath() == file->getSystem()->getName()) &&
|
||||||
(metadata == "systemName" || metadata == "systemFullname" ||
|
(metadata == "systemName" || metadata == "systemFullname" ||
|
||||||
metadata == "sourceSystemName" || metadata == "sourceSystemFullname")) {
|
metadata == "sourceSystemName" || metadata == "sourceSystemFullname")) {
|
||||||
text->setValue("");
|
text->setValue(text->getDefaultValue());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -691,7 +691,10 @@ void TextComponent::applyTheme(const std::shared_ptr<ThemeData>& theme,
|
||||||
mThemeMetadata = type;
|
mThemeMetadata = type;
|
||||||
if (elem->has("defaultValue")) {
|
if (elem->has("defaultValue")) {
|
||||||
if (mThemeMetadata == "developer" || mThemeMetadata == "publisher" ||
|
if (mThemeMetadata == "developer" || mThemeMetadata == "publisher" ||
|
||||||
mThemeMetadata == "genre" || mThemeMetadata == "players") {
|
mThemeMetadata == "genre" || mThemeMetadata == "players" ||
|
||||||
|
mThemeMetadata == "systemName" || mThemeMetadata == "systemFullname" ||
|
||||||
|
mThemeMetadata == "sourceSystemName" ||
|
||||||
|
mThemeMetadata == "sourceSystemFullname") {
|
||||||
const std::string& defaultValue {elem->get<std::string>("defaultValue")};
|
const std::string& defaultValue {elem->get<std::string>("defaultValue")};
|
||||||
if (defaultValue == ":space:")
|
if (defaultValue == ":space:")
|
||||||
mDefaultValue = " ";
|
mDefaultValue = " ";
|
||||||
|
|
|
@ -62,6 +62,8 @@ public:
|
||||||
std::string getHiddenValue() const override { return mHiddenText; }
|
std::string getHiddenValue() const override { return mHiddenText; }
|
||||||
void setHiddenValue(const std::string& value) override { setHiddenText(value); }
|
void setHiddenValue(const std::string& value) override { setHiddenText(value); }
|
||||||
|
|
||||||
|
const std::string getDefaultValue() const { return mDefaultValue; }
|
||||||
|
|
||||||
float const getOpacity() const override
|
float const getOpacity() const override
|
||||||
{
|
{
|
||||||
return static_cast<float>((mColor & 0x000000FF) / 255.0f);
|
return static_cast<float>((mColor & 0x000000FF) / 255.0f);
|
||||||
|
|
Loading…
Reference in a new issue