FWidgetPath FWeakWidgetPath::ToNextFocusedPath(EUINavigation NavigationType, const FNavigationReply& NavigationReply, const FArrangedWidget& RuleWidget) { check(NavigationType == EUINavigation::Next || NavigationType == EUINavigation::Previous); // Make a copy of the focus path. We will mutate it until it meets the necessary requirements. FWidgetPath NewFocusPath = this->ToWidgetPath(); TSharedPtr<SWidget> CurrentlyFocusedWidget = this->Widgets.Last().Pin(); bool bMovedFocus = false; // Attempt to move the focus starting at the leafmost widget and bubbling up to the root (i.e. the window) for (int32 FocusNodeIndex=NewFocusPath.Widgets.Num()-1; !bMovedFocus && FocusNodeIndex >= 0; --FocusNodeIndex) { // We've reached the stop boundary and not yet moved focus, so don't advance. if ( NavigationReply.GetBoundaryRule() == EUINavigationRule::Stop && RuleWidget.Widget == NewFocusPath.Widgets[FocusNodeIndex].Widget ) { break; } //TODO Slate Navigation Handle Wrap. bMovedFocus = NewFocusPath.MoveFocus(FocusNodeIndex, NavigationType); } return NewFocusPath; }