From 648de2fc00e7960c89aac7a8826aea758d6894a5 Mon Sep 17 00:00:00 2001 From: omar Date: Fri, 2 Feb 2018 18:38:18 +0100 Subject: [PATCH] Nav: Press Left on a child with ImGuiTreeNodeFlags_NavCloseFromChild moves you to parent node instead of closing it immediately. More standard. (#787, #1079) --- imgui.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 210132a7..a0e7e2c4 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -12545,9 +12545,7 @@ void ImGui::TreePop() if (g.NavMoveDir == ImGuiDir_Left && g.NavWindow == window && NavMoveRequestButNoResultYet()) if (g.NavIdIsAlive && (window->DC.TreeDepthMayCloseOnPop & (1 << window->DC.TreeDepth))) { - ImGuiID id = window->IDStack.back(); - window->DC.StateStorage->SetBool(id, false); - SetNavID(id, g.NavLayer); + SetNavID(window->IDStack.back(), g.NavLayer); NavMoveRequestCancel(); } window->DC.TreeDepthMayCloseOnPop &= (1 << window->DC.TreeDepth) - 1;