@ -910,7 +910,6 @@ namespace ImGui
static void NavUpdate ( ) ;
static void NavUpdateWindowing ( ) ;
static void NavUpdateWindowingOverlay ( ) ;
static void NavUpdateInitResult ( ) ;
static void NavUpdateCancelRequest ( ) ;
static void NavUpdateCreateMoveRequest ( ) ;
static float NavUpdatePageUpPageDown ( ) ;
@ -3332,7 +3331,7 @@ void ImGui::ItemInputable(ImGuiWindow* window, ImGuiID id)
}
if ( is_tab_stop & & window - > DC . FocusCounterTabStop = = g . TabFocusRequestCurrCounterTabStop )
{
g . NavJustTabbedId = id ;
g . NavJustTabbedId = id ; // FIXME-NAV: aim to eventually set in NavUpdate() once we finish the refactor
g . LastItemData . StatusFlags | = ImGuiItemStatusFlags_FocusedByTabbing ;
return ;
}
@ -8975,6 +8974,7 @@ void ImGui::NavMoveRequestSubmit(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavM
g . NavMoveResultLocal . Clear ( ) ;
g . NavMoveResultLocalVisible . Clear ( ) ;
g . NavMoveResultOther . Clear ( ) ;
NavUpdateAnyRequestFlag ( ) ;
}
void ImGui : : NavMoveRequestCancel ( )
@ -9150,9 +9150,7 @@ static void ImGui::NavUpdate()
ImGuiIO & io = g . IO ;
io . WantSetMousePos = false ;
#if 0
if ( g . NavScoringDebugCount > 0 ) IMGUI_DEBUG_LOG ( " NavScoringDebugCount %d for '%s' layer %d (Init:%d, Move:%d) \n " , g . NavScoringDebugCount , g . NavWindow ? g . NavWindow - > Name : " NULL " , g . NavLayer , g . NavInitRequest | | g . NavInitResultId ! = 0 , g . NavMoveRequest ) ;
# endif
//if (g.NavScoringDebugCount > 0) IMGUI_DEBUG_LOG("NavScoringDebugCount %d for '%s' layer %d (Init:%d, Move:%d)\n", g.NavScoringDebugCount, g.NavWindow ? g.NavWindow->Name : "NULL", g.NavLayer, g.NavInitRequest || g.NavInitResultId != 0, g.NavMoveRequest);
// Set input source as Gamepad when buttons are pressed (as some features differs when used with Gamepad vs Keyboard)
// (do it before we map Keyboard input!)
@ -9188,7 +9186,7 @@ static void ImGui::NavUpdate()
// Process navigation init request (select first/default focus)
if ( g . NavInitResultId ! = 0 )
Nav Update InitResult( ) ;
Nav InitRequestApply Result( ) ;
g . NavInitRequest = false ;
g . NavInitRequestFromMove = false ;
g . NavInitResultId = 0 ;
@ -9253,6 +9251,7 @@ static void ImGui::NavUpdate()
IM_ASSERT ( g . NavActivateDownId = = g . NavActivateId ) ;
// Process programmatic activation request
// FIXME-NAV: Those should eventually be queued (unlike focus they don't cancel each others)
if ( g . NavNextActivateId ! = 0 )
g . NavActivateId = g . NavActivateDownId = g . NavActivatePressedId = g . NavInputId = g . NavNextActivateId ;
g . NavNextActivateId = 0 ;
@ -9304,7 +9303,7 @@ static void ImGui::NavUpdate()
# endif
}
static void ImGui : : Nav Update InitResult( )
void ImGui : : Nav InitRequestApply Result( )
{
// In very rare cases g.NavWindow may be null (e.g. clearing focus after requesting an init request, which does happen when releasing Alt while clicking on void)
ImGuiContext & g = * GImGui ;
@ -9425,9 +9424,11 @@ void ImGui::NavMoveRequestApplyResult()
return ;
# endif
// No result
// Select which result to use
ImGuiNavItemData * result = ( g . NavMoveResultLocal . ID ! = 0 ) ? & g . NavMoveResultLocal : ( g . NavMoveResultOther . ID ! = 0 ) ? & g . NavMoveResultOther : NULL ;
// In a situation when there is no results but NavId != 0, re-enable the Navigation highlight (because g.NavId is not considered as a possible result)
if ( g . NavMoveResultLocal . ID = = 0 & & g . NavMoveResultOther . ID = = 0 )
if ( result = = NULL )
{
if ( g . NavId ! = 0 )
{
@ -9437,9 +9438,6 @@ void ImGui::NavMoveRequestApplyResult()
return ;
}
// Select which result to use
ImGuiNavItemData * result = ( g . NavMoveResultLocal . ID ! = 0 ) ? & g . NavMoveResultLocal : & g . NavMoveResultOther ;
// PageUp/PageDown behavior first jumps to the bottom/top mostly visible item, _otherwise_ use the result from the previous/next page.
if ( g . NavMoveFlags & ImGuiNavMoveFlags_AlsoScoreVisibleSet )
if ( g . NavMoveResultLocalVisible . ID ! = 0 & & g . NavMoveResultLocalVisible . ID ! = g . NavId )