Fix screen keyboard always open first in create server screen

This commit is contained in:
Benau 2020-07-12 08:42:53 +08:00
parent f4233977e5
commit 4d7fd73543
2 changed files with 16 additions and 0 deletions

@ -116,8 +116,21 @@ void CreateServerScreen::init()
assert(gamemode != NULL);
gamemode->setSelection(m_prev_mode, PLAYER_ID_GAME_MASTER);
updateMoreOption(m_prev_mode);
#ifdef MOBILE_STK
m_name_widget->setFocusable(true);
#endif
} // init
// ----------------------------------------------------------------------------
void CreateServerScreen::beforeAddingWidget()
{
#ifdef MOBILE_STK
// This will prevent name text box being focused first which make screen
// keyboard always open
m_name_widget->setFocusable(false);
#endif
} // beforeAddingWidget
// ----------------------------------------------------------------------------
/** Event callback which starts the server creation process.
*/

@ -62,6 +62,9 @@ public:
/** \brief implement callback from parent class GUIEngine::Screen */
virtual void loadedFromFile() OVERRIDE;
/** \brief implement callback from parent class GUIEngine::Screen */
virtual void beforeAddingWidget() OVERRIDE;
/** \brief implement callback from parent class GUIEngine::Screen */
virtual void eventCallback(GUIEngine::Widget* widget, const std::string& name,
const int playerID) OVERRIDE;