diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index dd5eeb36e..be244c933 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -46,6 +46,7 @@ Breaking changes: Other changes: +- Nav: keyboard/gamepad activation mark widgets as held to give better visual feedback. - Fixed SetKeyboardFocusHere() not working when current nav focus is in different scope, regression from 1.90.1 related to code scoping Tab presses to local scope. (#7226) [@bratpilz] - Debug Tools: Metrics: Fixed debug break in SetShortcutRouting() not handling ImGuiMod_Shortcut redirect. diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index 6b16f55b9..2b648a604 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -666,7 +666,9 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool else if (g.ActiveIdSource == ImGuiInputSource_Keyboard || g.ActiveIdSource == ImGuiInputSource_Gamepad) { // When activated using Nav, we hold on the ActiveID until activation button is released - if (g.NavActivateDownId != id) + if (g.NavActivateDownId == id) + held = true; + else ClearActiveID(); } if (pressed)