mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-06 04:58:47 +02:00
Nav: Fixed pressing Escape to leave menu layer while in a popup or child window. (#787)
This commit is contained in:
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
|
||||
|
Reference in New Issue
Block a user