Skip to content

Commit 003af74

Browse files
ClobberXDSmallJoker
authored andcommittedAug 7, 2019
guiConfirmRegistration: Set focus to text field (#8761)
1 parent fa6bc69 commit 003af74

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

Diff for: ‎src/gui/guiConfirmRegistration.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ void GUIConfirmRegistration::removeChildren()
6262
for (gui::IGUIElement *i : children_copy)
6363
i->remove();
6464
}
65+
6566
void GUIConfirmRegistration::regenerateGui(v2u32 screensize)
6667
{
6768
acceptInput();
@@ -119,6 +120,7 @@ void GUIConfirmRegistration::regenerateGui(v2u32 screensize)
119120
gui::IGUIEditBox *e = Environment->addEditBox(m_pass_confirm.c_str(),
120121
rect2, true, this, ID_confirmPassword);
121122
e->setPasswordBox(true);
123+
Environment->setFocus(e);
122124
}
123125

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

219221
if (event.GUIEvent.EventType == gui::EGET_ELEMENT_FOCUS_LOST && isVisible()) {
220222
if (!canTakeFocus(event.GUIEvent.Element)) {
221-
dstream << "GUIConfirmRegistration: Not allowing focus "
222-
"change."
223+
dstream << "GUIConfirmRegistration: Not allowing focus change."
223224
<< std::endl;
224225
// Returning true disables focus change
225226
return true;

0 commit comments

Comments
 (0)