Improve select all saves feature (fixes #725)
Ctrl+A no longer selects all saves if any of the textboxes in the view are in focus, as a ctrl+A in that case is expected to select everything in the textbox, not in the save browser. This change also makes the shortcut deselect all saves if all saves are selected. And no, I'm not making events cancellable just for this.
This commit is contained in:
parent
dd46bf7d42
commit
6ec87ed1ed
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user