@ -3701,7 +3701,7 @@ void ImGui::RenderNavHighlight(const ImRect& bb, ImGuiID id, ImGuiNavHighlightFl
ImGuiContext & g = * GImGui ;
if ( id ! = g . NavId )
return ;
if ( g . NavDisableHighlight & & ! ( flags & ImGuiNavHighlightFlags_AlwaysDraw ) )
if ( ! g . NavCursorVisible & & ! ( flags & ImGuiNavHighlightFlags_AlwaysDraw ) )
return ;
if ( id = = g . LastItemData . ID & & ( g . LastItemData . ItemFlags & ImGuiItemFlags_NoNav ) )
return ;
@ -3910,7 +3910,7 @@ ImGuiContext::ImGuiContext(ImFontAtlas* shared_font_atlas)
NavLastValidSelectionUserData = ImGuiSelectionUserData_Invalid ;
NavIdIsAlive = false ;
NavMousePosDirty = false ;
NavDisableHighlight = tru e ;
NavCursorVisible = fals e ;
NavDisableMouseHover = false ;
NavAnyRequest = false ;
@ -4444,7 +4444,7 @@ bool ImGui::IsItemHovered(ImGuiHoveredFlags flags)
ImGuiWindow * window = g . CurrentWindow ;
IM_ASSERT_USER_ERROR ( ( flags & ~ ImGuiHoveredFlags_AllowedMaskForIsItemHovered ) = = 0 , " Invalid flags for IsItemHovered()! " ) ;
if ( g . NavDisableMouseHover & & ! g . NavDisableHighlight & & ! ( flags & ImGuiHoveredFlags_NoNavOverride ) )
if ( g . NavDisableMouseHover & & g . NavCursorVisible & & ! ( flags & ImGuiHoveredFlags_NoNavOverride ) )
{
if ( ! IsItemFocused ( ) )
return false ;
@ -4824,7 +4824,7 @@ void ImGui::StartMouseMovingWindow(ImGuiWindow* window)
ImGuiContext & g = * GImGui ;
FocusWindow ( window ) ;
SetActiveID ( window - > MoveId , window ) ;
g . NavDisableHighlight = tru e ;
g . NavCursorVisible = fals e ;
g . ActiveIdClickOffset = g . IO . MouseClickedPos [ 0 ] - window - > RootWindow - > Pos ;
g . ActiveIdNoClearOnFocusLoss = true ;
SetActiveIdUsingAllKeyboardKeys ( ) ;
@ -5835,7 +5835,7 @@ bool ImGui::IsAnyItemActive()
bool ImGui : : IsAnyItemFocused ( )
{
ImGuiContext & g = * GImGui ;
return g . NavId ! = 0 & & ! g . NavDisableHighlight ;
return g . NavId ! = 0 & & g . NavCursorVisible ;
}
bool ImGui : : IsItemVisible ( )
@ -6689,7 +6689,7 @@ void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar
// Title bar only
const float backup_border_size = style . FrameBorderSize ;
g . Style . FrameBorderSize = window - > WindowBorderSize ;
ImU32 title_bar_col = GetColorU32 ( ( title_bar_is_highlight & & ! g . NavDisableHighlight ) ? ImGuiCol_TitleBgActive : ImGuiCol_TitleBgCollapsed ) ;
ImU32 title_bar_col = GetColorU32 ( ( title_bar_is_highlight & & g . NavCursorVisible ) ? ImGuiCol_TitleBgActive : ImGuiCol_TitleBgCollapsed ) ;
RenderFrame ( title_bar_rect . Min , title_bar_rect . Max , title_bar_col , true , window_rounding ) ;
g . Style . FrameBorderSize = backup_border_size ;
}
@ -12189,7 +12189,7 @@ ImVec2 ImGui::FindBestWindowPosForPopup(ImGuiWindow* window)
ImVec2 tooltip_pos = ref_pos + TOOLTIP_DEFAULT_OFFSET_MOUSE * scale ;
ImRect r_avoid ;
if ( ! g . NavDisableHighlight & & g . NavDisableMouseHover & & ! g . IO . ConfigNavMoveSetMousePos )
if ( g . NavCursorVisible & & g . NavDisableMouseHover & & ! g . IO . ConfigNavMoveSetMousePos )
r_avoid = ImRect ( ref_pos . x - 16 , ref_pos . y - 8 , ref_pos . x + 16 , ref_pos . y + 8 ) ;
else
r_avoid = ImRect ( ref_pos . x - 16 , ref_pos . y - 8 , ref_pos . x + 24 * scale , ref_pos . y + 24 * scale ) ; // FIXME: Hard-coded based on mouse cursor shape expectation. Exact dimension not very important.
@ -12272,7 +12272,7 @@ void ImGui::SetFocusID(ImGuiID id, ImGuiWindow* window)
if ( g . ActiveIdSource = = ImGuiInputSource_Keyboard | | g . ActiveIdSource = = ImGuiInputSource_Gamepad )
g . NavDisableMouseHover = true ;
else
g . NavDisableHighlight = tru e ;
g . NavCursorVisible = fals e ;
// Clear preferred scoring position (NavMoveRequestApplyResult() will tend to restore it)
NavClearPreferredPosForAxis ( ImGuiAxis_X ) ;
@ -12738,7 +12738,7 @@ void ImGui::NavRestoreLayer(ImGuiNavLayer layer)
void ImGui : : NavRestoreHighlightAfterMove ( )
{
ImGuiContext & g = * GImGui ;
g . NavDisableHighlight = fals e ;
g . NavCursorVisible = tru e ;
g . NavDisableMouseHover = g . NavMousePosDirty = true ;
}
@ -12789,7 +12789,7 @@ static ImGuiInputSource ImGui::NavCalcPreferredRefPosSource()
const bool activated_shortcut = g . ActiveId ! = 0 & & g . ActiveIdFromShortcut & & g . ActiveId = = g . LastItemData . ID ;
// Testing for !activated_shortcut here could in theory be removed if we decided that activating a remote shortcut altered one of the g.NavDisableXXX flag.
if ( ( g . NavDisableHighlight | | ! g . NavDisableMouseHover | | ! window ) & & ! activated_shortcut )
if ( ( ! g . NavCursorVisible | | ! g . NavDisableMouseHover | | ! window ) & & ! activated_shortcut )
return ImGuiInputSource_Mouse ;
else
return ImGuiInputSource_Keyboard ; // or Nav in general
@ -12897,7 +12897,7 @@ static void ImGui::NavUpdate()
// Schedule mouse position update (will be done at the bottom of this function, after 1) processing all move requests and 2) updating scrolling)
bool set_mouse_pos = false ;
if ( g . NavMousePosDirty & & g . NavIdIsAlive )
if ( ! g . NavDisableHighlight & & g . NavDisableMouseHover & & g . NavWindow )
if ( g . NavCursorVisible & & g . NavDisableMouseHover & & g . NavWindow )
set_mouse_pos = true ;
g . NavMousePosDirty = false ;
IM_ASSERT ( g . NavLayer = = ImGuiNavLayer_Main | | g . NavLayer = = ImGuiNavLayer_Menu ) ;
@ -12913,7 +12913,7 @@ static void ImGui::NavUpdate()
// Set output flags for user application
io . NavActive = ( nav_keyboard_active | | nav_gamepad_active ) & & g . NavWindow & & ! ( g . NavWindow - > Flags & ImGuiWindowFlags_NoNavInputs ) ;
io . NavVisible = ( io . NavActive & & g . NavId ! = 0 & & ! g . NavDisableHighlight ) | | ( g . NavWindowingTarget ! = NULL ) ;
io . NavVisible = ( io . NavActive & & g . NavId ! = 0 & & g . NavCursorVisible ) | | ( g . NavWindowingTarget ! = NULL ) ;
// Process NavCancel input (to close a popup, get back to parent, clear focus)
NavUpdateCancelRequest ( ) ;
@ -12921,7 +12921,7 @@ static void ImGui::NavUpdate()
// Process manual activation request
g . NavActivateId = g . NavActivateDownId = g . NavActivatePressedId = 0 ;
g . NavActivateFlags = ImGuiActivateFlags_None ;
if ( g . NavId ! = 0 & & ! g . NavDisableHighlight & & ! g . NavWindowingTarget & & g . NavWindow & & ! ( g . NavWindow - > Flags & ImGuiWindowFlags_NoNavInputs ) )
if ( g . NavId ! = 0 & & g . NavCursorVisible & & ! g . NavWindowingTarget & & g . NavWindow & & ! ( g . NavWindow - > Flags & ImGuiWindowFlags_NoNavInputs ) )
{
const bool activate_down = ( nav_keyboard_active & & IsKeyDown ( ImGuiKey_Space , ImGuiKeyOwner_NoOwner ) ) | | ( nav_gamepad_active & & IsKeyDown ( ImGuiKey_NavGamepadActivate , ImGuiKeyOwner_NoOwner ) ) ;
const bool activate_pressed = activate_down & & ( ( nav_keyboard_active & & IsKeyPressed ( ImGuiKey_Space , 0 , ImGuiKeyOwner_NoOwner ) ) | | ( nav_gamepad_active & & IsKeyPressed ( ImGuiKey_NavGamepadActivate , 0 , ImGuiKeyOwner_NoOwner ) ) ) ;
@ -12946,7 +12946,7 @@ static void ImGui::NavUpdate()
}
}
if ( g . NavWindow & & ( g . NavWindow - > Flags & ImGuiWindowFlags_NoNavInputs ) )
g . NavDisableHighlight = tru e ;
g . NavCursorVisible = fals e ;
if ( g . NavActivateId ! = 0 )
IM_ASSERT ( g . NavActivateDownId = = g . NavActivateId ) ;
@ -13003,7 +13003,7 @@ static void ImGui::NavUpdate()
// Always prioritize mouse highlight if navigation is disabled
if ( ! nav_keyboard_active & & ! nav_gamepad_active )
{
g . NavDisableHighlight = tru e ;
g . NavCursorVisible = fals e ;
g . NavDisableMouseHover = set_mouse_pos = false ;
}
@ -13147,7 +13147,7 @@ void ImGui::NavUpdateCreateMoveRequest()
IMGUI_DEBUG_LOG_NAV ( " [nav] NavInitRequest: from move, window \" %s \" , layer=%d \n " , window ? window - > Name : " <NULL> " , g . NavLayer ) ;
g . NavInitRequest = g . NavInitRequestFromMove = true ;
g . NavInitResult . ID = 0 ;
g . NavDisableHighlight = fals e ;
g . NavCursorVisible = tru e ;
}
// When using gamepad, we project the reference nav bounding box into window visible area.
@ -13211,7 +13211,7 @@ void ImGui::NavUpdateCreateTabbingRequest()
// See NavProcessItemForTabbingRequest() for a description of the various forward/backward tabbing cases with and without wrapping.
const bool nav_keyboard_active = ( g . IO . ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard ) ! = 0 ;
if ( nav_keyboard_active )
g . NavTabbingDir = g . IO . KeyShift ? - 1 : ( g . NavDisableHighlight = = tru e & & g . ActiveId = = 0 ) ? 0 : + 1 ;
g . NavTabbingDir = g . IO . KeyShift ? - 1 : ( g . NavCursorVisible = = fals e & & g . ActiveId = = 0 ) ? 0 : + 1 ;
else
g . NavTabbingDir = g . IO . KeyShift ? - 1 : ( g . ActiveId = = 0 ) ? 0 : + 1 ;
ImGuiNavMoveFlags move_flags = ImGuiNavMoveFlags_IsTabbing | ImGuiNavMoveFlags_Activate ;
@ -15823,7 +15823,7 @@ void ImGui::ShowMetricsWindow(bool* p_open)
Text ( " NavActive: %d, NavVisible: %d " , g . IO . NavActive , g . IO . NavVisible ) ;
Text ( " NavActivateId/DownId/PressedId: %08X/%08X/%08X " , g . NavActivateId , g . NavActivateDownId , g . NavActivatePressedId ) ;
Text ( " NavActivateFlags: %04X " , g . NavActivateFlags ) ;
Text ( " NavDisableHighlight : %d, NavDisableMouseHover: %d " , g . NavDisableHighlight , g . NavDisableMouseHover ) ;
Text ( " NavCursorVisible : %d, NavDisableMouseHover: %d " , g . NavCursorVisible , g . NavDisableMouseHover ) ;
Text ( " NavFocusScopeId = 0x%08X " , g . NavFocusScopeId ) ;
Text ( " NavFocusRoute[] = " ) ;
for ( int path_n = g . NavFocusRoute . Size - 1 ; path_n > = 0 ; path_n - - )