Clear editor search fields and yield focus on escape.

This commit is contained in:
Paul Chote
2017-09-02 09:40:08 +01:00
committed by reaperrr
parent 0ce4d91dd6
commit 3c1e7896a5
2 changed files with 14 additions and 0 deletions

View File

@@ -73,6 +73,13 @@ namespace OpenRA.Mods.Common.Widgets.Logic
InitializeTilePreview();
};
searchTextField.OnEscKey = () =>
{
searchTextField.Text = "";
searchTextField.YieldKeyboardFocus();
return true;
};
Func<string, string> categoryTitle = s => s != null ? s : "Search Results";
Func<string, ScrollItemWidget, ScrollItemWidget> setupItem = (option, template) =>
{