Skip to content

Commit

Permalink
guiConfirmRegistration: Set focus to text field (#8761)
Browse files Browse the repository at this point in the history
  • Loading branch information
ClobberXD authored and SmallJoker committed Aug 7, 2019
1 parent fa6bc69 commit 003af74
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/gui/guiConfirmRegistration.cpp
Expand Up @@ -62,6 +62,7 @@ void GUIConfirmRegistration::removeChildren()
for (gui::IGUIElement *i : children_copy)
i->remove();
}

void GUIConfirmRegistration::regenerateGui(v2u32 screensize)
{
acceptInput();
Expand Down Expand Up @@ -119,6 +120,7 @@ void GUIConfirmRegistration::regenerateGui(v2u32 screensize)
gui::IGUIEditBox *e = Environment->addEditBox(m_pass_confirm.c_str(),
rect2, true, this, ID_confirmPassword);
e->setPasswordBox(true);
Environment->setFocus(e);
}

ypos += 60 * s;
Expand Down Expand Up @@ -218,8 +220,7 @@ bool GUIConfirmRegistration::OnEvent(const SEvent &event)

if (event.GUIEvent.EventType == gui::EGET_ELEMENT_FOCUS_LOST && isVisible()) {
if (!canTakeFocus(event.GUIEvent.Element)) {
dstream << "GUIConfirmRegistration: Not allowing focus "
"change."
dstream << "GUIConfirmRegistration: Not allowing focus change."
<< std::endl;
// Returning true disables focus change
return true;
Expand Down

0 comments on commit 003af74

Please sign in to comment.