From d404b93b6bbcc6a652f14f43ee68588853449602 Mon Sep 17 00:00:00 2001 From: omar Date: Wed, 24 Jan 2018 19:57:39 +0100 Subject: [PATCH] Nav: Mouse clicking on a window (to select/move) disables hides nav highlight. (#787) + comments --- imgui.cpp | 1 + imgui_internal.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index 7e19e18b9..56060c4ed 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -3791,6 +3791,7 @@ void ImGui::EndFrame() // Set ActiveId even if the _NoMove flag is set, without it dragging away from a window with _NoMove would activate hover on other windows. FocusWindow(g.HoveredWindow); SetActiveID(g.HoveredWindow->MoveId, g.HoveredWindow); + g.NavDisableHighlight = true; g.ActiveIdClickOffset = g.IO.MousePos - g.HoveredRootWindow->Pos; if (!(g.HoveredWindow->Flags & ImGuiWindowFlags_NoMove) && !(g.HoveredRootWindow->Flags & ImGuiWindowFlags_NoMove)) g.MovingWindow = g.HoveredWindow; diff --git a/imgui_internal.h b/imgui_internal.h index c94cb222e..a3def3178 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -905,7 +905,7 @@ struct IMGUI_API ImGuiWindow ImVec2 SetWindowPosPivot; // store window pivot for positioning. ImVec2(0,0) when positioning from top-left corner; ImVec2(0.5f,0.5f) for centering; ImVec2(1,1) for bottom right. ImGuiID NavLastIds[2]; // Last known NavId for this window, per layer (0/1) - ImRect NavRectRel[2]; // Reference rectangle, in window space + ImRect NavRectRel[2]; // Reference rectangle, in window relative space ImGuiDrawContext DC; // Temporary per-window data, reset at the beginning of the frame ImVector IDStack; // ID stack. ID are hashes seeded with the value at the top of the stack