mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
fix focusing input on Save screen
This commit is contained in:
@@ -129,7 +129,7 @@ static ESortBy getSortBySelectionScreen(ESelectionScreen Type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SelectionTab::SelectionTab(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;
|
OBJ_CONSTRUCTION;
|
||||||
|
|
||||||
@@ -140,7 +140,7 @@ SelectionTab::SelectionTab(ESelectionScreen Type)
|
|||||||
sortingBy = _format;
|
sortingBy = _format;
|
||||||
background = std::make_shared<CPicture>("SCSELBCK.bmp", 0, 6);
|
background = std::make_shared<CPicture>("SCSELBCK.bmp", 0, 6);
|
||||||
pos = background->pos;
|
pos = background->pos;
|
||||||
inputName = std::make_shared<CTextInput>(Rect(32, 539, 350, 20), Point(-32, -25), "GSSTRIP.bmp", 0);
|
inputName = std::make_shared<CTextInput>(inputNameRect, Point(-32, -25), "GSSTRIP.bmp", 0);
|
||||||
inputName->filters += CTextInput::filenameFilter;
|
inputName->filters += CTextInput::filenameFilter;
|
||||||
labelMapSizes = std::make_shared<CLabel>(87, 62, FONT_SMALL, EAlignment::CENTER, Colors::YELLOW, CGI->generaltexth->allTexts[510]);
|
labelMapSizes = std::make_shared<CLabel>(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);
|
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -90,6 +90,7 @@ private:
|
|||||||
std::shared_ptr<CLabel> labelTabTitle;
|
std::shared_ptr<CLabel> labelTabTitle;
|
||||||
std::shared_ptr<CLabel> labelMapSizes;
|
std::shared_ptr<CLabel> labelMapSizes;
|
||||||
ESelectionScreen tabType;
|
ESelectionScreen tabType;
|
||||||
|
Rect inputNameRect;
|
||||||
|
|
||||||
void parseMaps(const std::unordered_set<ResourceID> & files);
|
void parseMaps(const std::unordered_set<ResourceID> & files);
|
||||||
void parseSaves(const std::unordered_set<ResourceID> & files);
|
void parseSaves(const std::unordered_set<ResourceID> & files);
|
||||||
|
Reference in New Issue
Block a user