Skip to content

Commit

Permalink
Menus: amend to clarify/fix static analyzer warning. (#6671, #6926)
Browse files Browse the repository at this point in the history
  • Loading branch information
ocornut committed Nov 29, 2023
1 parent 2ee40d3 commit b112d73
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion imgui_widgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7536,11 +7536,12 @@ bool ImGui::BeginMenuEx(const char* label, const char* icon, bool enabled)
want_close = true;

// Open
// (note: at this point 'hovered' actually includes the NavDisableMouseHover == false test)
if (!menu_is_open && pressed) // Click/activate to open
want_open = true;
else if (!menu_is_open && hovered && !moving_toward_child_menu) // Hover to open
want_open = true;
else if (!menu_is_open && hovered && !g.NavDisableMouseHover && g.HoveredIdTimer >= 0.30f && g.MouseStationaryTimer >= 0.30f) // Hover to open (timer fallback)
else if (!menu_is_open && hovered && g.HoveredIdTimer >= 0.30f && g.MouseStationaryTimer >= 0.30f) // Hover to open (timer fallback)
want_open = true;
if (g.NavId == id && g.NavMoveDir == ImGuiDir_Right) // Nav-Right to open
{
Expand Down

0 comments on commit b112d73

Please sign in to comment.