From f4e4c3870559781bb64c3817fe2f78ddf8979468 Mon Sep 17 00:00:00 2001 From: omar Date: Fri, 29 Sep 2017 22:19:53 +0200 Subject: [PATCH] BeginMenu(): fixed logic to distinguish vertical menu from one layed out in a menu bar. Makes MenuItem() in a regular window behave more consistently, and this will be also needed by upcoming menu-navigation changes in the nav branch. (#126, #787) --- imgui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index eb7e1ea0606e..08e697c40dd5 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -10029,7 +10029,7 @@ bool ImGui::BeginMenu(const char* label, bool enabled) g.NavWindow = backed_nav_window; bool want_open = false, want_close = false; - if (window->Flags & (ImGuiWindowFlags_Popup|ImGuiWindowFlags_ChildMenu)) + if (window->DC.LayoutType != ImGuiLayoutType_Horizontal) // (window->Flags & (ImGuiWindowFlags_Popup|ImGuiWindowFlags_ChildMenu)) { // Implement http://bjk5.com/post/44698559168/breaking-down-amazons-mega-dropdown to avoid using timers, so menus feels more reactive. bool moving_within_opened_triangle = false;