mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 06:05: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;
|
||||
}
|
||||
|
||||
std::string GuiComponent::getValue() const
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
void GuiComponent::setValue(const std::string& /*value*/)
|
||||
{
|
||||
}
|
||||
|
||||
std::string GuiComponent::getValue() const
|
||||
std::string GuiComponent::getHiddenValue() const
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
void GuiComponent::setHiddenValue(const std::string& /*value*/)
|
||||
{
|
||||
}
|
||||
|
||||
void GuiComponent::textInput(const char* text)
|
||||
{
|
||||
for (auto iter = mChildren.cbegin(); iter != mChildren.cend(); iter++)
|
||||
|
|
|
@ -161,6 +161,9 @@ public:
|
|||
virtual std::string getValue() const;
|
||||
virtual void setValue(const std::string& value);
|
||||
|
||||
virtual std::string getHiddenValue() const;
|
||||
virtual void setHiddenValue(const std::string& value);
|
||||
|
||||
virtual void onFocusGained() {};
|
||||
virtual void onFocusLost() {};
|
||||
|
||||
|
|
|
@ -114,6 +114,11 @@ void TextComponent::setText(const std::string& text)
|
|||
onTextChanged();
|
||||
}
|
||||
|
||||
void TextComponent::setHiddenText(const std::string& text)
|
||||
{
|
||||
mHiddenText = text;
|
||||
}
|
||||
|
||||
void TextComponent::setUppercase(bool uppercase)
|
||||
{
|
||||
mUppercase = uppercase;
|
||||
|
@ -265,14 +270,24 @@ void TextComponent::setLineSpacing(float spacing)
|
|||
onTextChanged();
|
||||
}
|
||||
|
||||
std::string TextComponent::getValue() const
|
||||
{
|
||||
return mText;
|
||||
}
|
||||
|
||||
void TextComponent::setValue(const std::string& 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,
|
||||
|
|
|
@ -39,6 +39,7 @@ public:
|
|||
void setUppercase(bool uppercase);
|
||||
void onSizeChanged() override;
|
||||
void setText(const std::string& text);
|
||||
void setHiddenText(const std::string& text);
|
||||
void setColor(unsigned int color) override;
|
||||
void setHorizontalAlignment(Alignment align);
|
||||
void setVerticalAlignment(Alignment align);
|
||||
|
@ -52,6 +53,9 @@ public:
|
|||
std::string getValue() const 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;
|
||||
void setOpacity(unsigned char opacity) override;
|
||||
|
||||
|
@ -64,6 +68,7 @@ protected:
|
|||
virtual void onTextChanged();
|
||||
|
||||
std::string mText;
|
||||
std::string mHiddenText;
|
||||
std::shared_ptr<Font> mFont;
|
||||
|
||||
private:
|
||||
|
|
Loading…
Reference in a new issue