Add a revertPreviousFocus() helper

This commit is contained in:
Bertrand Songis
2020-09-14 15:03:05 +02:00
parent 9a513b1fa3
commit 14b65cae3d
+8
View File
@@ -79,6 +79,14 @@ class ModalWindow: public Window
previousFocus = nullptr;
}
void revertPreviousFocus()
{
if (previousFocus) {
previousFocus->setFocus(SET_FOCUS_DEFAULT);
previousFocus = nullptr;
}
}
protected:
Window * previousFocus = nullptr;
bool closeAllowed = true;