diff --git a/src/gui/search/SearchModel.cpp b/src/gui/search/SearchModel.cpp index b921971d1..3208de8e6 100644 --- a/src/gui/search/SearchModel.cpp +++ b/src/gui/search/SearchModel.cpp @@ -201,9 +201,19 @@ void SearchModel::SelectSave(int saveID) void SearchModel::SelectAllSaves() { - for (int i = 0; i < saveList.size(); i++) + if (selected.size() == saveList.size()) { - SelectSave(saveList[i]->id); + for (auto &save : saveList) + { + DeselectSave(save->id); + } + } + else + { + for (auto &save : saveList) + { + SelectSave(save->id); + } } } diff --git a/src/gui/search/SearchView.cpp b/src/gui/search/SearchView.cpp index 449d2399c..d890c0cfb 100644 --- a/src/gui/search/SearchView.cpp +++ b/src/gui/search/SearchView.cpp @@ -654,7 +654,7 @@ void SearchView::OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctr return; if (key == SDLK_ESCAPE) c->Exit(); - else if (key == SDLK_a && ctrl) + else if ((focusedComponent_ != pageTextbox && focusedComponent_ != searchField) && scan == SDL_SCANCODE_A && ctrl) c->SelectAllSaves(); else if (key == SDLK_LCTRL || key == SDLK_RCTRL) c->InstantOpen(true);