fixed 823 -- mouse interaction with password fields uses the metrics of the mask character, not the actual content

This commit is contained in:
Chris Forbes
2011-05-23 19:57:40 +12:00
parent 0d63e9f999
commit aca4d2ebbb
2 changed files with 18 additions and 26 deletions

View File

@@ -12,16 +12,10 @@ namespace OpenRA.Widgets
{
public class PasswordFieldWidget : TextFieldWidget
{
public PasswordFieldWidget() : base() {}
protected PasswordFieldWidget(PasswordFieldWidget widget) : base(widget) {}
// TODO: Mouse interaction is wrong with this.
public override void DrawInner()
{
DrawWithString(new string('*', Text.Length));
}
public PasswordFieldWidget() : base() { }
protected PasswordFieldWidget(PasswordFieldWidget widget) : base(widget) { }
protected override string GetApparentText() { return new string('*', Text.Length); }
public override Widget Clone() { return new PasswordFieldWidget(this); }
}
}