Get default widget from modal dialog when it's active

This commit is contained in:
Deve 2018-11-19 21:42:43 +01:00
parent e6893aa58c
commit 70e82142d1

View File

@ -400,9 +400,19 @@ void EventHandler::sendNavigationEvent(const NavigationDirection nav, const int
if (w == NULL)
{
Widget* defaultWidget = NULL;
Screen* screen = GUIEngine::getCurrentScreen();
if (screen == NULL) return;
defaultWidget = screen->getFirstWidget();
if (ScreenKeyboard::isActive())
{
defaultWidget = ScreenKeyboard::getCurrent()->getFirstWidget();
}
else if (ModalDialog::isADialogActive())
{
defaultWidget = ModalDialog::getCurrent()->getFirstWidget();
}
else if (GUIEngine::getCurrentScreen() != NULL)
{
defaultWidget = GUIEngine::getCurrentScreen()->getFirstWidget();
}
if (defaultWidget != NULL)
{