diff --git a/client/lobby/SelectionTab.cpp b/client/lobby/SelectionTab.cpp index 0d135a915..e1d6226c3 100644 --- a/client/lobby/SelectionTab.cpp +++ b/client/lobby/SelectionTab.cpp @@ -129,7 +129,7 @@ static ESortBy getSortBySelectionScreen(ESelectionScreen Type) } SelectionTab::SelectionTab(ESelectionScreen Type) - : CIntObject(LCLICK | WHEEL | KEYBOARD | DOUBLECLICK), callOnSelect(nullptr), tabType(Type), selectionPos(0), sortModeAscending(true) + : CIntObject(LCLICK | WHEEL | KEYBOARD | DOUBLECLICK), callOnSelect(nullptr), tabType(Type), selectionPos(0), sortModeAscending(true), inputNameRect{32, 539, 350, 20} { OBJ_CONSTRUCTION; @@ -140,7 +140,7 @@ SelectionTab::SelectionTab(ESelectionScreen Type) sortingBy = _format; background = std::make_shared("SCSELBCK.bmp", 0, 6); pos = background->pos; - inputName = std::make_shared(Rect(32, 539, 350, 20), Point(-32, -25), "GSSTRIP.bmp", 0); + inputName = std::make_shared(inputNameRect, Point(-32, -25), "GSSTRIP.bmp", 0); inputName->filters += CTextInput::filenameFilter; labelMapSizes = std::make_shared(87, 62, FONT_SMALL, EAlignment::CENTER, Colors::YELLOW, CGI->generaltexth->allTexts[510]); @@ -273,6 +273,11 @@ void SelectionTab::clickLeft(tribool down, bool previousState) { select(line); } +#ifdef VCMI_IOS + // focus input field if clicked inside it + else if(inputName->active && inputNameRect.isIn(GH.current->button.x, GH.current->button.y)) + inputName->giveFocus(); +#endif } } diff --git a/client/lobby/SelectionTab.h b/client/lobby/SelectionTab.h index a6a974796..ebcdec668 100644 --- a/client/lobby/SelectionTab.h +++ b/client/lobby/SelectionTab.h @@ -90,6 +90,7 @@ private: std::shared_ptr labelTabTitle; std::shared_ptr labelMapSizes; ESelectionScreen tabType; + Rect inputNameRect; void parseMaps(const std::unordered_set & files); void parseSaves(const std::unordered_set & files);