Browse Source

Nav: keyboard/gamepad activation mark widgets as held to give better visual feedback.

pull/6085/merge
ocornut 10 months ago
parent
commit
d10641b04a
  1. 1
      docs/CHANGELOG.txt
  2. 4
      imgui_widgets.cpp

1
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.

4
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)

Loading…
Cancel
Save