Explorar o código

Deactivate on-screen keyboard if input is deactivated

Ivan Savenko hai 1 ano
pai
achega
0ab23c68f6
Modificáronse 1 ficheiros con 10 adicións e 2 borrados
  1. 10 2
      client/widgets/CTextInput.cpp

+ 10 - 2
client/widgets/CTextInput.cpp

@@ -266,19 +266,27 @@ void CTextInput::numberFilter(std::string & text, const std::string & oldText, i
 void CTextInput::activate()
 {
 	CFocusable::activate();
-#if !defined(VCMI_MOBILE)
 	if (hasFocus())
+	{
+#if defined(VCMI_MOBILE)
+		//giveFocus();
+#else
 		GH.startTextInput(pos);
 #endif
+	}
 }
 
 void CTextInput::deactivate()
 {
 	CFocusable::deactivate();
-#if !defined(VCMI_MOBILE)
 	if (hasFocus())
+	{
+#if defined(VCMI_MOBILE)
+		removeFocus();
+#else
 		GH.stopTextInput();
 #endif
+	}
 }
 
 void CTextInput::onFocusGot()