defocus components removed from scrollpanels, to prevent crashes
This commit is contained in:
parent
17302f03c7
commit
f814d264b2
@ -68,7 +68,7 @@ class LoadFilesTask: public Task
|
|||||||
{
|
{
|
||||||
std::vector<unsigned char> data = Client::Ref().ReadFile(*iter);
|
std::vector<unsigned char> data = Client::Ref().ReadFile(*iter);
|
||||||
GameSave * tempSave = new GameSave(data);
|
GameSave * tempSave = new GameSave(data);
|
||||||
saveFile->SetGameSave(tempSave);
|
saveFile->SetGameSave(tempSave);
|
||||||
saveFiles.push_back(saveFile);
|
saveFiles.push_back(saveFile);
|
||||||
|
|
||||||
std::string filename = *iter;
|
std::string filename = *iter;
|
||||||
|
@ -82,6 +82,8 @@ void Panel::RemoveChild(Component* c)
|
|||||||
{
|
{
|
||||||
//remove child from parent. Does not free memory
|
//remove child from parent. Does not free memory
|
||||||
children.erase(children.begin() + i);
|
children.erase(children.begin() + i);
|
||||||
|
if (this->GetParentWindow()->IsFocused(c))
|
||||||
|
this->GetParentWindow()->FocusComponent(NULL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,7 @@ LocalSaveActivity::LocalSaveActivity(SaveFile save, FileSavedCallback * callback
|
|||||||
filenameField->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
filenameField->Appearance.VerticalAlign = ui::Appearance::AlignMiddle;
|
||||||
filenameField->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
filenameField->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
||||||
AddComponent(filenameField);
|
AddComponent(filenameField);
|
||||||
|
FocusComponent(filenameField);
|
||||||
|
|
||||||
ui::Button * cancelButton = new ui::Button(ui::Point(0, Size.Y-16), ui::Point(Size.X-75, 16), "Cancel");
|
ui::Button * cancelButton = new ui::Button(ui::Point(0, Size.Y-16), ui::Point(Size.X-75, 16), "Cancel");
|
||||||
cancelButton->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
cancelButton->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
||||||
|
Loading…
Reference in New Issue
Block a user