1
0
mirror of https://github.com/ocornut/imgui.git synced 2024-11-28 09:30:56 +01:00

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.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;