From cb4e6c8212d736e1ac0ac5a5911239af23660fc8 Mon Sep 17 00:00:00 2001 From: omar Date: Tue, 3 Oct 2017 13:44:48 -0700 Subject: [PATCH] Nav: Selectable(): activating selectable also sets NavId + removed the MouseDelta test (added in 43ee5d73e9f524320489720639942ff60bbfaf54, #323) as I don't think it is needed. (#787) --- imgui.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 112ce24e..954f6424 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -9788,11 +9788,12 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl selected = false; // Hovering selectable with mouse updates NavId accordingly so navigation can be resumed with gamepad/keyboard (this doesn't happen on most widgets) - if (hovered && !g.NavDisableMouseHover && g.NavWindow == window && (g.IO.MouseDelta.x != 0.0f || g.IO.MouseDelta.y != 0.0f)) - { - g.NavDisableHighlight = true; - SetNavId(id, window->DC.NavLayerCurrent); - } + if (pressed || hovered)// && (g.IO.MouseDelta.x != 0.0f || g.IO.MouseDelta.y != 0.0f)) + if (!g.NavDisableMouseHover && g.NavWindow == window) + { + g.NavDisableHighlight = true; + SetNavId(id, window->DC.NavLayerCurrent); + } // Render if (hovered || selected)