Nav: Fixed inability to cancel nav in modal popups. (#5400)

This commit is contained in:
Rokas Kupstys 2022-06-17 11:14:16 +03:00 committed by ocornut
parent 07efd7cc20
commit 37a07858a9
3 changed files with 4 additions and 4 deletions

View File

@ -87,6 +87,7 @@ Other Changes:
- Nav: Fixed issues with nav request being transferred to another window when calling SetKeyboardFocusHere() - Nav: Fixed issues with nav request being transferred to another window when calling SetKeyboardFocusHere()
and simultaneous changing window focus. (#4449) and simultaneous changing window focus. (#4449)
- Nav: Changed SetKeyboardFocusHere() to not behave if a drag or window moving is in progress. - Nav: Changed SetKeyboardFocusHere() to not behave if a drag or window moving is in progress.
- Nav: Fixed inability to cancel nav in modal popups. (#5400) [@rokups]
- IsItemHovered(): added ImGuiHoveredFlags_NoNavOverride to disable the behavior where the - IsItemHovered(): added ImGuiHoveredFlags_NoNavOverride to disable the behavior where the
return value is overriden by focus when gamepad/keyboard navigation is active. return value is overriden by focus when gamepad/keyboard navigation is active.
- InputText: Fixed pressing Tab emitting two tabs characters because of dual Keys/Chars events being - InputText: Fixed pressing Tab emitting two tabs characters because of dual Keys/Chars events being

View File

@ -10630,11 +10630,10 @@ static void ImGui::NavUpdateCancelRequest()
SetNavID(child_window->ChildId, ImGuiNavLayer_Main, 0, WindowRectAbsToRel(parent_window, child_rect)); SetNavID(child_window->ChildId, ImGuiNavLayer_Main, 0, WindowRectAbsToRel(parent_window, child_rect));
NavRestoreHighlightAfterMove(); NavRestoreHighlightAfterMove();
} }
else if (g.OpenPopupStack.Size > 0) else if (g.OpenPopupStack.Size > 0 && !(g.OpenPopupStack.back().Window->Flags & ImGuiWindowFlags_Modal))
{ {
// Close open popup/menu // Close open popup/menu
if (!(g.OpenPopupStack.back().Window->Flags & ImGuiWindowFlags_Modal)) ClosePopupToLevel(g.OpenPopupStack.Size - 1, true);
ClosePopupToLevel(g.OpenPopupStack.Size - 1, true);
} }
else else
{ {

View File

@ -65,7 +65,7 @@ Index of this file:
// Version // Version
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens) // (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens)
#define IMGUI_VERSION "1.88 WIP" #define IMGUI_VERSION "1.88 WIP"
#define IMGUI_VERSION_NUM 18730 #define IMGUI_VERSION_NUM 18731
#define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert), sizeof(ImDrawIdx)) #define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert), sizeof(ImDrawIdx))
#define IMGUI_HAS_TABLE #define IMGUI_HAS_TABLE