From d761825cfb92ed4d5ce8fa5abfc59f6c20d77023 Mon Sep 17 00:00:00 2001 From: omar Date: Fri, 13 Oct 2017 22:33:06 +0200 Subject: [PATCH] Nav: Renaming a field + Comments. --- imgui.cpp | 6 +++--- imgui.h | 4 ++-- imgui_internal.h | 13 +++++++------ 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index fd16860c..454457f9 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -1970,7 +1970,7 @@ void ImGui::SetActiveID(ImGuiID id, ImGuiWindow* window) if (id) { g.ActiveIdIsAlive = true; - g.ActiveIdSource = (g.NavActivateId == id || g.NavInputId == id || g.NavJustTabbedId == id || g.NavJustNavigatedId == id) ? ImGuiInputSource_Nav : ImGuiInputSource_Mouse; + g.ActiveIdSource = (g.NavActivateId == id || g.NavInputId == id || g.NavJustTabbedId == id || g.NavJustMovedToId == id) ? ImGuiInputSource_Nav : ImGuiInputSource_Mouse; } } @@ -2748,7 +2748,7 @@ static void NavUpdate() g.NavInitRequest = false; g.NavInitResultExplicit = false; g.NavInitResultId = 0; - g.NavJustNavigatedId = 0; + g.NavJustMovedToId = 0; // Process navigation move request if (g.NavMoveRequest && g.NavMoveResultId != 0) @@ -2761,7 +2761,7 @@ static void NavUpdate() // Apply result from previous frame navigation directional move request ImGui::ClearActiveID(); SetNavIDAndMoveMouse(g.NavMoveResultId, g.NavLayer, g.NavMoveResultRectRel); - g.NavJustNavigatedId = g.NavMoveResultId; + g.NavJustMovedToId = g.NavMoveResultId; g.NavMoveFromClampedRefRect = false; } diff --git a/imgui.h b/imgui.h index 8c6b8f44..0a69e924 100644 --- a/imgui.h +++ b/imgui.h @@ -902,8 +902,8 @@ struct ImGuiIO bool WantCaptureKeyboard; // Widget is active (= ImGui will use your keyboard input). Use to hide keyboard from the rest of your application bool WantTextInput; // Some text input widget is active, which will read input characters from the InputCharacters array. Use to activate on screen keyboard if your system needs one bool WantMoveMouse; // MousePos has been altered. back-end should reposition mouse on next frame. used only if 'NavMovesMouse=true'. - bool NavUsable; // Directional navigation is currently allowed (ImGuiKey_NavXXX events). - bool NavActive; // Directional navigation is active/visible and currently allowed (ImGuiKey_NavXXX events). + bool NavUsable; // Directional navigation is currently allowed (will handle ImGuiKey_NavXXX events). + bool NavActive; // Directional navigation is active/visible and currently allowed (will handle ImGuiKey_NavXXX events). float Framerate; // Application framerate estimation, in frame per second. Solely for convenience. Rolling average estimation based on IO.DeltaTime over 120 frames int MetricsAllocs; // Number of active memory allocations int MetricsRenderVertices; // Vertices output during last call to Render() diff --git a/imgui_internal.h b/imgui_internal.h index 7f9ee7a1..fd646eff 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -463,13 +463,14 @@ struct ImGuiContext ImVector CurrentPopupStack; // Which level of BeginPopup() we are in (reset every frame) // Navigation data (for gamepad/keyboard) - ImGuiWindow* NavWindow; // Nav/focused window for navigation - ImGuiID NavId; // Nav/focused item for navigation - ImGuiID NavActivateId, NavActivateDownId; // ~~ IsNavInputPressed(ImGuiNavInput_PadActivate) ? NavId : 0, etc. - ImGuiID NavInputId; // ~~ IsNavInputPressed(ImGuiNavInput_PadInput) ? NavId : 0, etc. + ImGuiWindow* NavWindow; // Focused window for navigation + ImGuiID NavId; // Focused item for navigation + ImGuiID NavActivateId; // ~~ IsNavInputPressed(ImGuiNavInput_PadActivate) ? NavId : 0, also set when calling ActivateItem() + ImGuiID NavActivateDownId; // ~~ IsNavInputPressed(ImGuiNavInput_PadActivate) ? NavId : 0 + ImGuiID NavInputId; // ~~ IsNavInputPressed(ImGuiNavInput_PadInput) ? NavId : 0 ImGuiID NavJustTabbedId; // Just tabbed to this id. - ImGuiID NavJustNavigatedId; // Just navigated to this id (result of a successfully MoveRequest) ImGuiID NavNextActivateId; // Set by ActivateItem(), queued until next frame + ImGuiID NavJustMovedToId; // Just navigated to this id (result of a successfully MoveRequest) ImRect NavScoringRectScreen; // Rectangle used for scoring, in screen space. Based of window->DC.NavRefRectRel[], modified for directional navigation scoring. ImGuiWindow* NavWindowingTarget; float NavWindowingDisplayAlpha; @@ -586,7 +587,7 @@ struct ImGuiContext NavWindow = NULL; NavId = NavActivateId = NavActivateDownId = NavInputId = 0; - NavJustTabbedId = NavJustNavigatedId = NavNextActivateId = 0; + NavJustTabbedId = NavJustMovedToId = NavNextActivateId = 0; NavScoringRectScreen = ImRect(); NavWindowingTarget = NULL; NavWindowingDisplayAlpha = 0.0f;