@ -3163,7 +3163,7 @@ bool ImGui::IsItemHovered(ImGuiHoveredFlags flags)
ImGuiWindow * window = g . CurrentWindow ;
ImGuiWindow * window = g . CurrentWindow ;
if ( g . NavDisableMouseHover & & ! g . NavDisableHighlight )
if ( g . NavDisableMouseHover & & ! g . NavDisableHighlight )
{
{
if ( ( g. CurrentItem Flags & ImGuiItemFlags_Disabled ) & & ! ( flags & ImGuiHoveredFlags_AllowWhenDisabled ) )
if ( ( window- > DC . LastItemIn Flags & ImGuiItemFlags_Disabled ) & & ! ( flags & ImGuiHoveredFlags_AllowWhenDisabled ) )
return false ;
return false ;
return IsItemFocused ( ) ;
return IsItemFocused ( ) ;
}
}
@ -3194,7 +3194,7 @@ bool ImGui::IsItemHovered(ImGuiHoveredFlags flags)
return false ;
return false ;
// Test if the item is disabled
// Test if the item is disabled
if ( ( g. CurrentItem Flags & ImGuiItemFlags_Disabled ) & & ! ( flags & ImGuiHoveredFlags_AllowWhenDisabled ) )
if ( ( window- > DC . LastItemIn Flags & ImGuiItemFlags_Disabled ) & & ! ( flags & ImGuiHoveredFlags_AllowWhenDisabled ) )
return false ;
return false ;
// Special handling for calling after Begin() which represent the title bar or tab.
// Special handling for calling after Begin() which represent the title bar or tab.
@ -3270,10 +3270,11 @@ bool ImGui::IsClippedEx(const ImRect& bb, ImGuiID id, bool clip_even_when_logged
// This is also inlined in ItemAdd()
// This is also inlined in ItemAdd()
// Note: if ImGuiItemStatusFlags_HasDisplayRect is set, user needs to set window->DC.LastItemDisplayRect!
// Note: if ImGuiItemStatusFlags_HasDisplayRect is set, user needs to set window->DC.LastItemDisplayRect!
void ImGui : : SetLastItemData ( ImGuiWindow * window , ImGuiID item_id , ImGuiItem StatusFlags item _flags, const ImRect & item_rect )
void ImGui : : SetLastItemData ( ImGuiWindow * window , ImGuiID item_id , ImGuiItem Flags item_flags , ImGuiItem StatusFlags item _status _flags, const ImRect & item_rect )
{
{
window - > DC . LastItemId = item_id ;
window - > DC . LastItemId = item_id ;
window - > DC . LastItemStatusFlags = item_flags ;
window - > DC . LastItemInFlags = item_flags ;
window - > DC . LastItemStatusFlags = item_status_flags ;
window - > DC . LastItemRect = item_rect ;
window - > DC . LastItemRect = item_rect ;
}
}
@ -6332,7 +6333,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
// We fill last item data based on Title Bar/Tab, in order for IsItemHovered() and IsItemActive() to be usable after Begin().
// We fill last item data based on Title Bar/Tab, in order for IsItemHovered() and IsItemActive() to be usable after Begin().
// This is useful to allow creating context menus on title bar only, etc.
// This is useful to allow creating context menus on title bar only, etc.
SetLastItemData ( window , window - > MoveId , IsMouseHoveringRect( title_bar_rect . Min , title_bar_rect . Max , false ) ? ImGuiItemStatusFlags_HoveredRect : 0 , title_bar_rect ) ;
SetLastItemData ( window , window - > MoveId , g. CurrentItemFlags , IsMouseHoveringRect( title_bar_rect . Min , title_bar_rect . Max , false ) ? ImGuiItemStatusFlags_HoveredRect : 0 , title_bar_rect ) ;
# ifdef IMGUI_ENABLE_TEST_ENGINE
# ifdef IMGUI_ENABLE_TEST_ENGINE
if ( ! ( window - > Flags & ImGuiWindowFlags_NoTitleBar ) )
if ( ! ( window - > Flags & ImGuiWindowFlags_NoTitleBar ) )
@ -7484,6 +7485,7 @@ bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg, ImGu
// Equivalent to calling SetLastItemData()
// Equivalent to calling SetLastItemData()
window - > DC . LastItemId = id ;
window - > DC . LastItemId = id ;
window - > DC . LastItemRect = bb ;
window - > DC . LastItemRect = bb ;
window - > DC . LastItemInFlags = g . CurrentItemFlags ;
window - > DC . LastItemStatusFlags = ImGuiItemStatusFlags_None ;
window - > DC . LastItemStatusFlags = ImGuiItemStatusFlags_None ;
g . NextItemData . Flags = ImGuiNextItemDataFlags_None ;
g . NextItemData . Flags = ImGuiNextItemDataFlags_None ;