Disabled: fixed IsItemHovered() returning true on disabled item when navigated to. (#211)

docking
ocornut 3 years ago
parent 5dd1e38b7a
commit 638e1a721b

@ -63,6 +63,7 @@ Other Changes:
- Disabled: disabled items set HoveredId, allowing e.g. HoveredIdTimer to function. (#211, #3419) [@rokups]
- Disabled: disabled mode more consistently release active id if the active item got disabled. (#211)
- Disabled: disabled mode doesn't prevent Selectable() from looking selected. (#211)
- Disabled: fixed IsItemHovered() returning true on disabled item when navigated to. (#211)
- Fixed printf-style format checks on non-MinGW flavors. (#4183, #3592)
- Fonts: Functions with a 'float size_pixels' parameter can accept zero if it is set in ImFontSize::SizePixels.
- Fonts: Prefer using U+FFFD character for fallback instead of '?', if available. (#4269)

@ -3162,7 +3162,11 @@ bool ImGui::IsItemHovered(ImGuiHoveredFlags flags)
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
if (g.NavDisableMouseHover && !g.NavDisableHighlight)
{
if ((g.CurrentItemFlags & ImGuiItemFlags_Disabled) && !(flags & ImGuiHoveredFlags_AllowWhenDisabled))
return false;
return IsItemFocused();
}
// Test for bounding box overlap, as updated as ItemAdd()
ImGuiItemStatusFlags status_flags = window->DC.LastItemStatusFlags;

Loading…
Cancel
Save