summaryrefslogtreecommitdiff
path: root/src/gui/widgets/passwordfield.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/passwordfield.cpp')
-rw-r--r--src/gui/widgets/passwordfield.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/widgets/passwordfield.cpp b/src/gui/widgets/passwordfield.cpp
index f0dd0f256..f301f2fe7 100644
--- a/src/gui/widgets/passwordfield.cpp
+++ b/src/gui/widgets/passwordfield.cpp
@@ -26,7 +26,8 @@
PasswordField::PasswordField(const Widget2 *const widget,
const std::string &text):
- TextField(widget, text)
+ TextField(widget, text),
+ mPasswordChar(mSkin ? mSkin->getOption("passwordChar", 42) : 42)
{
}
@@ -34,7 +35,10 @@ void PasswordField::draw(gcn::Graphics *graphics)
{
// std::string uses cow, thus cheap copy
const std::string original = mText;
- mText.assign(mText.length(), '*');
+ if (mPasswordChar)
+ mText.assign(mText.length(), mPasswordChar);
+ else
+ mText = "";
TextField::draw(graphics);
mText = original;
}