IsItemHovered(): Added ImGuiHoveredFlags_AllowWhenDisabled flag to query hovered status on disabled items. (#1940, #211)

+ shallow changelog tweaks
This commit is contained in:
omar
2018-07-10 19:16:57 +02:00
parent fff014dfed
commit 9007dff5eb
4 changed files with 8 additions and 6 deletions

View File

@ -2699,7 +2699,7 @@ bool ImGui::IsItemHovered(ImGuiHoveredFlags flags)
return false;
// Test if the item is disabled
if (window->DC.ItemFlags & ImGuiItemFlags_Disabled)
if ((window->DC.ItemFlags & ImGuiItemFlags_Disabled) && !(flags & ImGuiHoveredFlags_AllowWhenDisabled))
return false;
// Special handling for the 1st item after Begin() which represent the title bar. When the window is collapsed (SkipItems==true) that last item will never be overwritten so we need to detect tht case.