mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 23:55:38 +00:00
Added support for hidden text fields (intended for passwords).
This commit is contained in:
parent
8131b81761
commit
1af7e3eda4
|
@ -319,15 +319,24 @@ const Transform4x4f& GuiComponent::getTransform()
|
||||||
return mTransform;
|
return mTransform;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string GuiComponent::getValue() const
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
void GuiComponent::setValue(const std::string& /*value*/)
|
void GuiComponent::setValue(const std::string& /*value*/)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string GuiComponent::getValue() const
|
std::string GuiComponent::getHiddenValue() const
|
||||||
{
|
{
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GuiComponent::setHiddenValue(const std::string& /*value*/)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void GuiComponent::textInput(const char* text)
|
void GuiComponent::textInput(const char* text)
|
||||||
{
|
{
|
||||||
for (auto iter = mChildren.cbegin(); iter != mChildren.cend(); iter++)
|
for (auto iter = mChildren.cbegin(); iter != mChildren.cend(); iter++)
|
||||||
|
|
|
@ -161,6 +161,9 @@ public:
|
||||||
virtual std::string getValue() const;
|
virtual std::string getValue() const;
|
||||||
virtual void setValue(const std::string& value);
|
virtual void setValue(const std::string& value);
|
||||||
|
|
||||||
|
virtual std::string getHiddenValue() const;
|
||||||
|
virtual void setHiddenValue(const std::string& value);
|
||||||
|
|
||||||
virtual void onFocusGained() {};
|
virtual void onFocusGained() {};
|
||||||
virtual void onFocusLost() {};
|
virtual void onFocusLost() {};
|
||||||
|
|
||||||
|
|
|
@ -114,6 +114,11 @@ void TextComponent::setText(const std::string& text)
|
||||||
onTextChanged();
|
onTextChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TextComponent::setHiddenText(const std::string& text)
|
||||||
|
{
|
||||||
|
mHiddenText = text;
|
||||||
|
}
|
||||||
|
|
||||||
void TextComponent::setUppercase(bool uppercase)
|
void TextComponent::setUppercase(bool uppercase)
|
||||||
{
|
{
|
||||||
mUppercase = uppercase;
|
mUppercase = uppercase;
|
||||||
|
@ -265,14 +270,24 @@ void TextComponent::setLineSpacing(float spacing)
|
||||||
onTextChanged();
|
onTextChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string TextComponent::getValue() const
|
||||||
|
{
|
||||||
|
return mText;
|
||||||
|
}
|
||||||
|
|
||||||
void TextComponent::setValue(const std::string& value)
|
void TextComponent::setValue(const std::string& value)
|
||||||
{
|
{
|
||||||
setText(value);
|
setText(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string TextComponent::getValue() const
|
std::string TextComponent::getHiddenValue() const
|
||||||
{
|
{
|
||||||
return mText;
|
return mHiddenText;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TextComponent::setHiddenValue(const std::string& value)
|
||||||
|
{
|
||||||
|
setHiddenText(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextComponent::applyTheme(const std::shared_ptr<ThemeData>& theme, const std::string& view,
|
void TextComponent::applyTheme(const std::shared_ptr<ThemeData>& theme, const std::string& view,
|
||||||
|
|
|
@ -39,6 +39,7 @@ public:
|
||||||
void setUppercase(bool uppercase);
|
void setUppercase(bool uppercase);
|
||||||
void onSizeChanged() override;
|
void onSizeChanged() override;
|
||||||
void setText(const std::string& text);
|
void setText(const std::string& text);
|
||||||
|
void setHiddenText(const std::string& text);
|
||||||
void setColor(unsigned int color) override;
|
void setColor(unsigned int color) override;
|
||||||
void setHorizontalAlignment(Alignment align);
|
void setHorizontalAlignment(Alignment align);
|
||||||
void setVerticalAlignment(Alignment align);
|
void setVerticalAlignment(Alignment align);
|
||||||
|
@ -52,6 +53,9 @@ public:
|
||||||
std::string getValue() const override;
|
std::string getValue() const override;
|
||||||
void setValue(const std::string& value) override;
|
void setValue(const std::string& value) override;
|
||||||
|
|
||||||
|
std::string getHiddenValue() const override;
|
||||||
|
void setHiddenValue(const std::string& value) override;
|
||||||
|
|
||||||
unsigned char getOpacity() const override;
|
unsigned char getOpacity() const override;
|
||||||
void setOpacity(unsigned char opacity) override;
|
void setOpacity(unsigned char opacity) override;
|
||||||
|
|
||||||
|
@ -64,6 +68,7 @@ protected:
|
||||||
virtual void onTextChanged();
|
virtual void onTextChanged();
|
||||||
|
|
||||||
std::string mText;
|
std::string mText;
|
||||||
|
std::string mHiddenText;
|
||||||
std::shared_ptr<Font> mFont;
|
std::shared_ptr<Font> mFont;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in a new issue