Show cursor in edit box when screen keyboard is opened

This commit is contained in:
Deve 2019-02-13 21:00:17 +01:00
parent 05b1dcb803
commit 71c5c3988c
2 changed files with 8 additions and 2 deletions

View File

@ -143,6 +143,9 @@ namespace GUIEngine
/** Returns height of the screen keyboard */
int getHeight() {return m_area.getHeight();}
/** Returns assigned edit box */
CGUIEditBox* getEditBox() {return m_edit_box;}
};
}

View File

@ -964,7 +964,10 @@ void CGUIEditBox::draw()
if (!IsVisible)
return;
const bool focus = Environment->hasFocus(this);
GUIEngine::ScreenKeyboard* screen_kbd = GUIEngine::ScreenKeyboard::getCurrent();
bool has_screen_kbd = (screen_kbd && screen_kbd->getEditBox() == this);
const bool focus = Environment->hasFocus(this) || has_screen_kbd;
IGUISkin* skin = Environment->getSkin();
if (!skin)