From e55882f74b5608331f355f5240cd56a9e5937910 Mon Sep 17 00:00:00 2001 From: ocornut Date: Sun, 7 Aug 2016 15:18:04 +0200 Subject: [PATCH] Nav: Allow PadLeft to close a menu (#323) --- imgui.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/imgui.cpp b/imgui.cpp index 221b2147..c96fdf99 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -9779,6 +9779,11 @@ bool ImGui::BeginMenu(const char* label, bool enabled) want_open = true; g.NavMoveRequest = false; } + if (g.NavWindow && g.NavWindow->ParentWindow == window && g.NavMoveRequest && g.NavMoveDir == ImGuiNavDir_Left) // Nav-Left to close + { + want_close = true; + g.NavMoveRequest = false; + } } else if (menu_is_open && pressed && menuset_is_open) // Menu bar: click an open menu again to close it {