1
0
mirror of https://github.com/ocornut/imgui.git synced 2024-11-24 15:50:25 +01:00

Nav: Mouse clicking on a window (to select/move) disables hides nav highlight. (#787) + comments

This commit is contained in:
omar 2018-01-24 19:57:39 +01:00
parent 89b0ca1f8f
commit d404b93b6b
2 changed files with 2 additions and 1 deletions

View File

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

View File

@ -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<ImGuiID> IDStack; // ID stack. ID are hashes seeded with the value at the top of the stack