Nav: Press Left on a child with ImGuiTreeNodeFlags_NavCloseFromChild moves you to parent node instead of closing it immediately. More standard. (#787, #1079)

This commit is contained in:
omar 2018-02-02 18:38:18 +01:00
parent ce9d7baaba
commit 648de2fc00

View File

@ -12545,9 +12545,7 @@ void ImGui::TreePop()
if (g.NavMoveDir == ImGuiDir_Left && g.NavWindow == window && NavMoveRequestButNoResultYet()) if (g.NavMoveDir == ImGuiDir_Left && g.NavWindow == window && NavMoveRequestButNoResultYet())
if (g.NavIdIsAlive && (window->DC.TreeDepthMayCloseOnPop & (1 << window->DC.TreeDepth))) if (g.NavIdIsAlive && (window->DC.TreeDepthMayCloseOnPop & (1 << window->DC.TreeDepth)))
{ {
ImGuiID id = window->IDStack.back(); SetNavID(window->IDStack.back(), g.NavLayer);
window->DC.StateStorage->SetBool(id, false);
SetNavID(id, g.NavLayer);
NavMoveRequestCancel(); NavMoveRequestCancel();
} }
window->DC.TreeDepthMayCloseOnPop &= (1 << window->DC.TreeDepth) - 1; window->DC.TreeDepthMayCloseOnPop &= (1 << window->DC.TreeDepth) - 1;