mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-20 01:34:20 +00:00
Nav: Fixed pressing Escape to leave menu layer while in a popup or child window. (#787)
This commit is contained in:
parent
21428ad3f4
commit
b493cae8c9
3 changed files with 9 additions and 8 deletions
10
imgui.cpp
10
imgui.cpp
|
|
@ -9114,6 +9114,11 @@ static void ImGui::NavUpdate()
|
|||
if (!IsActiveIdUsingNavInput(ImGuiNavInput_Cancel))
|
||||
ClearActiveID();
|
||||
}
|
||||
else if (g.NavLayer != ImGuiNavLayer_Main)
|
||||
{
|
||||
// Leave the "menu" layer
|
||||
NavRestoreLayer(ImGuiNavLayer_Main);
|
||||
}
|
||||
else if (g.NavWindow && g.NavWindow != g.NavWindow->RootWindow && !(g.NavWindow->Flags & ImGuiWindowFlags_Popup) && g.NavWindow->ParentWindow)
|
||||
{
|
||||
// Exit child window
|
||||
|
|
@ -9130,11 +9135,6 @@ static void ImGui::NavUpdate()
|
|||
if (!(g.OpenPopupStack.back().Window->Flags & ImGuiWindowFlags_Modal))
|
||||
ClosePopupToLevel(g.OpenPopupStack.Size - 1, true);
|
||||
}
|
||||
else if (g.NavLayer != ImGuiNavLayer_Main)
|
||||
{
|
||||
// Leave the "menu" layer
|
||||
NavRestoreLayer(ImGuiNavLayer_Main);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Clear NavLastId for popups but keep it for regular child window so we can leave one and come back where we were
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue